GNOME Bugzilla – Bug 622159
Build failure: undeclared variable in gvfsftpdircache.c
Last modified: 2011-08-25 17:26:51 UTC
Building gvfs-1.4.3 on OS X 10.4/ppc: gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I../common -I.. -I/sw/include/glib-2.0 -I/sw/lib/glib-2.0/include -I/sw/include/gio-unix-2.0/ -I/sw/include/dbus-1.0 -I/sw/lib/dbus-1.0/include -I/sw/include/gnome-keyring-1 -I/sw/include/glib-2.0 -I/sw/lib/glib-2.0/include -DDBUS_API_SUBJECT_TO_CHANGE -DG_UDEV_API_IS_SUBJECT_TO_CHANGE -DLIBEXEC_DIR=\"/sw/libexec/\" -DMOUNTABLE_DIR=\"/sw/share/gvfs/mounts/\" -DGVFS_LOCALEDIR=\""/sw/share/locale"\" -DG_DISABLE_DEPRECATED -DBACKEND_HEADER=gvfsbackendftp.h -DDEFAULT_BACKEND_TYPE=ftp -DMAX_JOB_THREADS=10 -DBACKEND_TYPES='"ftp", G_VFS_TYPE_BACKEND_FTP,' -I/sw/include -g -O2 -MT gvfsd_ftp-gvfsftpdircache.o -MD -MP -MF .deps/gvfsd_ftp-gvfsftpdircache.Tpo -c -o gvfsd_ftp-gvfsftpdircache.o `test -f 'gvfsftpdircache.c' || echo './'`gvfsftpdircache.c gvfsftpdircache.c: In function 'g_vfs_ftp_dir_cache_funcs_process': gvfsftpdircache.c:589: error: 'unix' undeclared (first use in this function) gvfsftpdircache.c:589: error: (Each undeclared identifier is reported only once gvfsftpdircache.c:589: error: for each function it appears in.) make[2]: *** [gvfsd_ftp-gvfsftpdircache.o] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 The relevant code (which is still the same in git trunk) is in the function: >static gboolean >g_vfs_ftp_dir_cache_funcs_process (GInputStream * stream, > int debug_id, > const GVfsFtpFile * dir, > GVfsFtpDirCacheEntry *entry, > gboolean is_unix, > GCancellable * cancellable, > GError ** error) >{ >[...lots of code, none of which declares "unix"...] > if (unix) > g_file_info_set_is_hidden (info, result.fe_fnlen > 0 && > result.fe_fname[0] == '.'); I assume it works on linux because "unix" is a declared variable or token or something? But I also assume that in this context it's supposed to be testing the is_unix parameter to this function, a variable that is not used anywhere else in this function.
Created attachment 164111 [details] [review] Fix variable-name Interestingly, even enabling maximum-warnings doesn't catch this on platforms where it would have compiled successfully. At least according to my gcc manpage, -Wall doesn't entail -Wunused-parameters
Hi Daniel. Thanks for finding and fixing this! Very interesting indeed. This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report. http://git.gnome.org/browse/gvfs/commit/?id=202234cde5528dd62f9a6b1c3d3fb3c333952b0e
*** Bug 604685 has been marked as a duplicate of this bug. ***