After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 591228 - Compiler warnings building from git
Compiler warnings building from git
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: build
git master
Other Linux
: Normal minor
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2009-08-09 12:15 UTC by Luca Ferretti
Modified: 2013-09-26 21:06 UTC
See Also:
GNOME target: ---
GNOME version: 2.27/2.28


Attachments
fix warnings for mtp (3.42 KB, patch)
2013-09-26 11:17 UTC, Ondrej Holy
committed Details | Review
fix wornings for goa (1.13 KB, patch)
2013-09-26 11:17 UTC, Ondrej Holy
committed Details | Review
fix warnings for cdda (1.18 KB, patch)
2013-09-26 11:18 UTC, Ondrej Holy
none Details | Review
fix warning for mount (709 bytes, patch)
2013-09-26 11:18 UTC, Ondrej Holy
committed Details | Review
fix warning for smb (576 bytes, patch)
2013-09-26 11:18 UTC, Ondrej Holy
committed Details | Review
fix warning for gdbus (802 bytes, patch)
2013-09-26 11:19 UTC, Ondrej Holy
committed Details | Review
255814: fix warnings for cdda (1.18 KB, patch)
2013-09-26 11:58 UTC, Ondrej Holy
committed Details | Review
fix warning for mtp (2.28 KB, patch)
2013-09-26 12:30 UTC, Ondrej Holy
none Details | Review
fix compilation warnings for GDeamonFileEnumerator (801 bytes, patch)
2013-09-26 12:32 UTC, Ondrej Holy
committed Details | Review
fix compilation warnings for gdbus (825 bytes, patch)
2013-09-26 12:38 UTC, Ondrej Holy
committed Details | Review

Description Luca Ferretti 2009-08-09 12:15:16 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
Comment 1 Kjartan Maraas 2011-05-23 20:19:04 UTC
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.
Comment 2 Ondrej Holy 2013-09-26 10:05:32 UTC
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;
            ^
Comment 3 Ondrej Holy 2013-09-26 11:17:22 UTC
Created attachment 255812 [details] [review]
fix warnings for mtp

Not sure if get_file_for_filename isn't there intentionally for future use.
Comment 4 Ondrej Holy 2013-09-26 11:17:51 UTC
Created attachment 255813 [details] [review]
fix wornings for goa
Comment 5 Ondrej Holy 2013-09-26 11:18:12 UTC
Created attachment 255814 [details] [review]
fix warnings for cdda
Comment 6 Ondrej Holy 2013-09-26 11:18:36 UTC
Created attachment 255815 [details] [review]
fix warning for mount
Comment 7 Ondrej Holy 2013-09-26 11:18:56 UTC
Created attachment 255816 [details] [review]
fix warning for smb
Comment 8 Ondrej Holy 2013-09-26 11:19:24 UTC
Created attachment 255817 [details] [review]
fix warning for gdbus
Comment 9 Alexander Larsson 2013-09-26 11:38:12 UTC
Review of attachment 255813 [details] [review]:

ack
Comment 10 Alexander Larsson 2013-09-26 11:38:43 UTC
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)
Comment 11 Alexander Larsson 2013-09-26 11:38:53 UTC
Review of attachment 255815 [details] [review]:

ack
Comment 12 Alexander Larsson 2013-09-26 11:39:00 UTC
Review of attachment 255816 [details] [review]:

ack
Comment 13 Alexander Larsson 2013-09-26 11:39:09 UTC
Review of attachment 255817 [details] [review]:

ack
Comment 14 Alexander Larsson 2013-09-26 11:42:02 UTC
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 15 Ondrej Holy 2013-09-26 11:55:43 UTC
Comment on attachment 255813 [details] [review]
fix wornings for goa

commit a4ac941872838a5f14d1d3a61c15dc5c21caceec
Comment 16 Ondrej Holy 2013-09-26 11:56:11 UTC
Comment on attachment 255815 [details] [review]
fix warning for mount

commit 8de3770b845a76e6ed22ac610811d0fe7e29f4cb
Comment 17 Ondrej Holy 2013-09-26 11:56:38 UTC
Comment on attachment 255816 [details] [review]
fix warning for smb

commit 19249f9eb50639484caec9adad5bc353ed103181
Comment 18 Ondrej Holy 2013-09-26 11:56:55 UTC
Comment on attachment 255817 [details] [review]
fix warning for gdbus

commit a878a1ff2404d4544a98f242a095cec1851d3ae5
Comment 19 Ondrej Holy 2013-09-26 11:58:43 UTC
Created attachment 255823 [details] [review]
255814: fix warnings for cdda

commit 89287cdea32db6c67f787cfcb07b7e4b3669c2a3
Comment 20 Ondrej Holy 2013-09-26 12:30:58 UTC
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.
Comment 21 Ondrej Holy 2013-09-26 12:32:24 UTC
Created attachment 255826 [details] [review]
fix compilation warnings for GDeamonFileEnumerator

New compilation warnings have been introduced in last commits...
Comment 22 Ondrej Holy 2013-09-26 12:38:50 UTC
Created attachment 255828 [details] [review]
fix compilation warnings for gdbus
Comment 23 Alexander Larsson 2013-09-26 13:13:48 UTC
Review of attachment 255826 [details] [review]:

ack
Comment 24 Alexander Larsson 2013-09-26 13:13:58 UTC
Review of attachment 255828 [details] [review]:

ack
Comment 25 Ondrej Holy 2013-09-26 13:19:14 UTC
Comment on attachment 255828 [details] [review]
fix compilation warnings for gdbus

commit 8966e2db6c19aa0ab54a7ff16fa6b7a4fa1b0695
Comment 26 Ondrej Holy 2013-09-26 13:19:40 UTC
Comment on attachment 255826 [details] [review]
fix compilation warnings for GDeamonFileEnumerator

commit 5a239267e6d32ab0029a18d8090876dc8c188180
Comment 27 Ondrej Holy 2013-09-26 13:32:10 UTC
Philip, could you look at the attachment 255812 [details] [review]?
Comment 28 Ondrej Holy 2013-09-26 13:42:19 UTC
Comment on attachment 255812 [details] [review]
fix warnings for mtp

commit fdf5ae5cc3068377ba66302698e170922af38478
Comment 29 Philip Langdale 2013-09-26 21:06:21 UTC
Patch was fine.