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 622159 - Build failure: undeclared variable in gvfsftpdircache.c
Build failure: undeclared variable in gvfsftpdircache.c
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: build
unspecified
Other Mac OS
: Normal major
: ---
Assigned To: gvfs-maint
gvfs-maint
: 604685 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-06-20 09:01 UTC by Daniel Macks
Modified: 2011-08-25 17:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix variable-name (564 bytes, patch)
2010-06-20 09:05 UTC, Daniel Macks
none Details | Review

Description Daniel Macks 2010-06-20 09:01:39 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.
Comment 1 Daniel Macks 2010-06-20 09:05:37 UTC
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
Comment 2 Andreas Henriksson 2010-06-23 08:53:33 UTC
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
Comment 3 André Klapper 2011-08-25 17:26:51 UTC
*** Bug 604685 has been marked as a duplicate of this bug. ***