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 310903 - Compile error: missing define for call to readlink()
Compile error: missing define for call to readlink()
Status: RESOLVED FIXED
Product: gnome-keyring
Classification: Core
Component: general
git master
Other Linux
: Urgent blocker
: ---
Assigned To: GNOME keyring maintainer(s)
GNOME keyring maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2005-07-19 17:51 UTC by Stéphan Kochen
Modified: 2005-08-30 07:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12


Attachments
proposed patch (for both _possible_ gcc 4 bugs) (1.32 KB, patch)
2005-07-20 11:30 UTC, Stéphan Kochen
none Details | Review

Description Stéphan Kochen 2005-07-19 17:51:41 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.
Comment 1 Stéphan Kochen 2005-07-20 11:27:06 UTC
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.
Comment 2 Stéphan Kochen 2005-07-20 11:30:57 UTC
Created attachment 49453 [details] [review]
proposed patch (for both _possible_ gcc 4 bugs)
Comment 3 Luis Villa 2005-07-21 23:30:15 UTC
I'm seeing the same thing, very Not Good. James, oh great tools god, have you
any guidance?
Comment 4 James Henstridge 2005-07-22 13:16:18 UTC
/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
Comment 5 Stéphan Kochen 2005-07-25 11:09:11 UTC
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.
Comment 6 Alexander Larsson 2005-08-30 07:47:37 UTC
fixed in cvs.