GNOME Bugzilla – Bug 310903
Compile error: missing define for call to readlink()
Last modified: 2005-08-30 07:47:37 UTC
Version details: cvs head 2005-07-19 Distribution/Version: Ubuntu Breezy Building gnome-keyring from cvs with jhbuild, the following error occurs: source='gnome-keyring-daemon.c' object='gnome-keyring-daemon.o' libtool=no \ depfile='.deps/gnome-keyring-daemon.Po' tmpdepfile='.deps/gnome-keyring-daemon.TPo' \ depmode=gcc3 /bin/sh ./depcomp \ gcc -DHAVE_CONFIG_H -I. -I. -I. -DPREFIX=\""/opt/gnome2"\" -DBINDIR=\""/opt/gnome2/bin"\" -DLIBEXECDIR=\""/opt/gnome2/libexec"\" -DGNOMELOCALEDIR=\""/opt/gnome2/share/locale"\" -I. -I. -D_XOPEN_SOURCE -I/opt/gnome2/include/gtk-2.0 -I/opt/gnome2/lib/gtk-2.0/include -I/opt/gnome2/include -I/opt/gnome2/include/atk-1.0 -I/usr/include/freetype2 -I/opt/gnome2/include/cairo -I/opt/gnome2/include/pango-1.0 -I/usr/include/libpng12 -I/usr/X11R6/include -I/opt/gnome2/include/glib-2.0 -I/opt/gnome2/lib/glib-2.0/include -I/opt/gnome2/include/glib-2.0 -I/opt/gnome2/lib/glib-2.0/include -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -Werror -g -O2 -Wno-strict-aliasing -Wno-sign-compare -c `test -f 'gnome-keyring-daemon.c' || echo './'`gnome-keyring-daemon.c cc1: warnings being treated as errors gnome-keyring-daemon.c: In function ‘gnome_keyring_application_ref_new_from_pid’: gnome-keyring-daemon.c:347: let op: implicit declaration of function ‘readlink’ gnome-keyring-daemon.c:347: let op: nested extern declaration of ‘readlink’ make[2]: *** [gnome-keyring-daemon.o] Fout 1 make[2]: Leaving directory `/opt/gnome2/src/gnome-keyring' readlink() is in unistd.h, but apparently disabled as follows: #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K I'm not very familiar with autotools voodoo, but this looks like it's just missing a define somewhere.
This might be a GCC 4 problem? I managed to fix this by defining _GNU_SOURCE in Makefile.am. I also consistently managed to fix similar errors in other projects with just that define. I also encountered several other errors which I repeatedly bump into, one of which I bumped into in gnome-keyring as well, when I went on with the compile. Seems GCC 4 doesn't like empty sentinels, and you need to supply atleast two NULLs in that case. Rather odd. I'm not going to rename the bug until someone can confirm this, though.
Created attachment 49453 [details] [review] proposed patch (for both _possible_ gcc 4 bugs)
I'm seeing the same thing, very Not Good. James, oh great tools god, have you any guidance?
/me wonders where this james@daa.com.au bugzilla account came from This is related to _XOPEN_SOURCE being defined in the .pc files distributed with breezy (which are the new modular Xorg X libraries). Daniel Stone says that this will be fixed soon. Relevant bug tracker links: https://bugs.freedesktop.org/show_bug.cgi?id=3797 https://bugzilla.ubuntu.com/show_bug.cgi?id=12786
The error I originally filed the bug for seems to have been fixed. _XOPEN_SOURCE is no longer defined. I however still get the following: source='gnome-keyring-ask.c' object='gnome-keyring-ask.o' libtool=no \ depfile='.deps/gnome-keyring-ask.Po' tmpdepfile='.deps/gnome-keyring-ask.TPo' \ depmode=gcc3 /bin/sh ./depcomp \ gcc -DHAVE_CONFIG_H -I. -I. -I. -DPREFIX=\""/opt/gnome2"\" -DBINDIR=\""/opt/gnome2/bin"\" -DLIBEXECDIR=\""/opt/gnome2/libexec"\" -DGNOMELOCALEDIR=\""/opt/gnome2/share/locale"\" -I. -I. -I/opt/gnome2/include/gtk-2.0 -I/opt/gnome2/lib/gtk-2.0/include -I/opt/gnome2/include -I/opt/gnome2/include/atk-1.0 -I/usr/include/freetype2 -I/opt/gnome2/include/cairo -I/opt/gnome2/include/pango-1.0 -I/usr/include/libpng12 -I/opt/gnome2/include/glib-2.0 -I/opt/gnome2/lib/glib-2.0/include -I/opt/gnome2/include/glib-2.0 -I/opt/gnome2/lib/glib-2.0/include -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -Werror -g -O2 -Wno-strict-aliasing -Wno-sign-compare -c `test -f 'gnome-keyring-ask.c' || echo './'`gnome-keyring-ask.c cc1: warnings being treated as errors gnome-keyring-ask.c: In function ‘run_dialog’: gnome-keyring-ask.c:93: let op: not enough variable arguments to fit a sentinel ...which is the other bug the patch I submitted is supposed to cover.
fixed in cvs.