GNOME Bugzilla – Bug 591228
Compiler warnings building from git
Last modified: 2013-09-26 21:06:21 UTC
meta-daemon.c: In function ‘metadata_get’: meta-daemon.c:361: warning: passing argument 2 of ‘g_ptr_array_add’ discards qualifiers from pointer target type meta-daemon.c:370: warning: passing argument 1 of ‘g_free’ discards qualifiers from pointer target type meta-get-tree.c: In function ‘main’: meta-get-tree.c:54: warning: ignoring return value of ‘gets’, declared with attribute warn_unused_result meta-get-tree.o: In function `gets': /usr/include/bits/stdio2.h:229: warning: the `gets' function is dangerous and should not be used. gdaemonvfs.c: In function ‘_g_daemon_vfs_append_metadata_for_set’: gdaemonvfs.c:1251: warning: passing argument 1 of ‘g_free’ discards qualifiers from pointer target type gdaemonfileenumerator.c: In function ‘trigger_async_done’: gdaemonfileenumerator.c:272: warning: passing argument 2 of ‘g_list_foreach’ from incompatible pointer type libtool: link: ( cd ".libs" && rm -f "libgvfsdbus.la" && ln -s "../libgvfsdbus.la" "libgvfsdbus.la" ) <command-line>: warning: "G_LOG_DOMAIN" redefined <command-line>: warning: this is the location of the previous definition pty_open.c: In function ‘_pty_run_on_pty’: pty_open.c:345: warning: ignoring return value of ‘chdir’, declared with attribute warn_unused_result gvfsftpdircache.c: In function ‘g_vfs_ftp_dir_cache_lookup_file_internal’: gvfsftpdircache.c:194: warning: ‘info’ may be used uninitialized in this function gvfsbackendftp.c: In function ‘ftp_output_stream_splice’: gvfsbackendftp.c:1167: warning: ‘cancel_cb_id’ may be used uninitialized in this function gvfsbackendftp.c:1166: warning: ‘timer_cancel’ may be used uninitialized in this function gproxymountoperation.c: In function ‘g_proxy_mount_operation_handle_show_processes’: gproxymountoperation.c:322: warning: ‘processes’ may be used uninitialized in this function gvfs-mount.c: In function ‘prompt_for’: gvfs-mount.c:95: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
Looks like these have all been fixed by now. The only warning I see with gcc 4.6.0 is this: /home/kmaraas/src/gnome/gvfs/metadata/meta-get-tree.c:54: warning: the `gets' function is dangerous and should not be used. And this is used in a test / helper binary which isn't installed so it shouldn't really be a problem anyway.
There are still some compilation warnings (gvfs 1.18.0 and gcc 4.8.1): gdaemonfile.c: In function 'g_daemon_file_get_relative_path': gdaemonfile.c:382:16: warning: unused variable 'ok' [-Wunused-variable] gboolean ok; ^ smburi.c: In function 'smb_to_uri': smburi.c:269:3: warning: implicit declaration of function 'atoi' [-Wimplicit-function-declaration] if (port && (port_num = atoi (port))) ^ mount.c: In function ‘handle_unregister_mount’: mount.c:966:13: warning: unused variable ‘mount’ [-Wunused-variable] VfsMount *mount; ^ gvfsbackendcdda.c: In function ‘on_uevent’: gvfsbackendcdda.c:240:7: warning: passing argument 1 of ‘g_vfs_backend_force_unmount’ from incompatible pointer type [enabled by default] g_vfs_backend_force_unmount (cdda_backend); ^ In file included from gvfsbackendcdda.h:26:0, from gvfsbackendcdda.c:50: ./gvfsbackend.h:499:13: note: expected ‘struct _GVfsBackend *’ but argument is of type ‘struct GVfsBackendCdda *’ void g_vfs_backend_force_unmount (GVfsBackend *backend); ^ gvfsbackendmtp.c: In function ‘do_query_fs_info’: gvfsbackendmtp.c:1319:2: warning: label ‘exit’ defined but not used [-Wunused-label] exit: ^ gvfsbackendmtp.c: In function ‘do_read’: gvfsbackendmtp.c:1915:9: warning: unused variable ‘size’ [-Wunused-variable] gsize size = handle->size; ^ gvfsbackendmtp.c: In function ‘do_write’: gvfsbackendmtp.c:2220:39: warning: pointer targets in passing argument 4 of ‘LIBMTP_SendPartialObject’ differ in signedness [-Wpointer-sign] buffer, buffer_size); ^ In file included from gvfsbackendmtp.c:37:0: /usr/include/libmtp.h:1015:5: note: expected ‘unsigned char *’ but argument is of type ‘char *’ int LIBMTP_SendPartialObject(LIBMTP_mtpdevice_t *, uint32_t const, ^ gvfsbackendmtp.c:2214:9: warning: unused variable ‘size’ [-Wunused-variable] gsize size = handle->size; ^ gvfsbackendmtp.c: At top level: gvfsbackendmtp.c:486:1: warning: ‘emit_change_event’ defined but not used [-Wunused-function] emit_change_event (gpointer key, ^ gvfsbackendmtp.c:1173:1: warning: ‘get_file_for_filename’ defined but not used [-Wunused-function] get_file_for_filename (LIBMTP_mtpdevice_t *device, ^ goavolumemonitor.c: In function ‘g_vfs_goa_volume_monitor_get_mount_for_uuid’: goavolumemonitor.c:354:25: warning: unused variable ‘self’ [-Wunused-variable] GVfsGoaVolumeMonitor *self = G_VFS_GOA_VOLUME_MONITOR (_self); ^ goavolumemonitor.c: In function ‘g_vfs_goa_volume_monitor_get_volume_for_uuid’: goavolumemonitor.c:393:12: warning: unused variable ‘value’ [-Wunused-variable] gpointer value; ^
Created attachment 255812 [details] [review] fix warnings for mtp Not sure if get_file_for_filename isn't there intentionally for future use.
Created attachment 255813 [details] [review] fix wornings for goa
Created attachment 255814 [details] [review] fix warnings for cdda
Created attachment 255815 [details] [review] fix warning for mount
Created attachment 255816 [details] [review] fix warning for smb
Created attachment 255817 [details] [review] fix warning for gdbus
Review of attachment 255813 [details] [review]: ack
Review of attachment 255814 [details] [review]: ::: daemon/gvfsbackendcdda.c @@ +238,3 @@ g_udev_device_get_property_as_int (device, "ID_CDROM_MEDIA") != 1)) { + g_vfs_backend_force_unmount ((GVfsBackend *)cdda_backend); Would prefer GVFS_BACKEND(cdda_backend)
Review of attachment 255815 [details] [review]: ack
Review of attachment 255816 [details] [review]: ack
Review of attachment 255817 [details] [review]: ack
Review of attachment 255812 [details] [review]: The simpler changes look OK to me, but removing the functions, i dunno, i didn't look at the backend much. Maybe they are sometimes used during debuging or something. I can't really tell. Also, do we never emit change events? Anyway, maybe you can just #if 0 out those instead for now.
Comment on attachment 255813 [details] [review] fix wornings for goa commit a4ac941872838a5f14d1d3a61c15dc5c21caceec
Comment on attachment 255815 [details] [review] fix warning for mount commit 8de3770b845a76e6ed22ac610811d0fe7e29f4cb
Comment on attachment 255816 [details] [review] fix warning for smb commit 19249f9eb50639484caec9adad5bc353ed103181
Comment on attachment 255817 [details] [review] fix warning for gdbus commit a878a1ff2404d4544a98f242a095cec1851d3ae5
Created attachment 255823 [details] [review] 255814: fix warnings for cdda commit 89287cdea32db6c67f787cfcb07b7e4b3669c2a3
Created attachment 255825 [details] [review] fix warning for mtp (In reply to comment #14) > Review of attachment 255812 [details] [review]: > > The simpler changes look OK to me, but removing the functions, i dunno, i > didn't look at the backend much. Maybe they are sometimes used during debuging > or something. I can't really tell. get_file_for_filename isn't used in this file, however as I wrote before, don't know if it is good idea, putting #if 0 instead. > Also, do we never emit change events? Change events isn't used in this file, however putting #if 0 instead.
Created attachment 255826 [details] [review] fix compilation warnings for GDeamonFileEnumerator New compilation warnings have been introduced in last commits...
Created attachment 255828 [details] [review] fix compilation warnings for gdbus
Review of attachment 255826 [details] [review]: ack
Review of attachment 255828 [details] [review]: ack
Comment on attachment 255828 [details] [review] fix compilation warnings for gdbus commit 8966e2db6c19aa0ab54a7ff16fa6b7a4fa1b0695
Comment on attachment 255826 [details] [review] fix compilation warnings for GDeamonFileEnumerator commit 5a239267e6d32ab0029a18d8090876dc8c188180
Philip, could you look at the attachment 255812 [details] [review]?
Comment on attachment 255812 [details] [review] fix warnings for mtp commit fdf5ae5cc3068377ba66302698e170922af38478
Patch was fine.