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 444097 - Cannot compile gtksearchenginesimple.c
Cannot compile gtksearchenginesimple.c
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.11.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2007-06-04 20:45 UTC by Jens Granseuer
Modified: 2007-06-10 17:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
config.h (7.44 KB, text/plain)
2007-06-04 21:16 UTC, Jens Granseuer
  Details
config.log (92.63 KB, text/plain)
2007-06-04 21:17 UTC, Jens Granseuer
  Details
[PATCH] Unconditionally define GNU libc symbols in GtkSearchEngineSimple (606 bytes, patch)
2007-06-05 18:38 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review

Description Jens Granseuer 2007-06-04 20:45:28 UTC
gtksearchenginesimple.c:199: warning: `struct FTW' declared inside parameter list
gtksearchenginesimple.c:199: warning: its scope is only this definition or declaration, which is probably not what you want.
gtksearchenginesimple.c: In function `search_visit_func':
gtksearchenginesimple.c:248: warning: assignment discards qualifiers from pointer target type
gtksearchenginesimple.c: In function `search_thread_func':
gtksearchenginesimple.c:293: warning: implicit declaration of function `nftw'
gtksearchenginesimple.c:297: `FTW_PHYS' undeclared (first use in this function)

configure determined that

#undef HAVE_GNU_FTW
#define HAVE_FTW_H 1

However, if I modify the block at the top of the file

#ifdef HAVE_GNU_FTW
#define _XOPEN_SOURCE 500
#define _GNU_SOURCE
#endif

to define those two symbols unconditionally, the build succeeds.
Seems I don't have GNU FTW but still need those.
Comment 1 Emmanuele Bassi (:ebassi) 2007-06-04 21:11:04 UTC
does this happen with a clean check out of trunk? it's quite odd: the FTW structure and nftw() are part of the POSIX file tree walk API, which is included if HAVE_FTW_H is defined - which apparently is. what configure checks, aside from the existence of ftw.h, is whether ftw.h enables the GNU libc extensions. if no _XOPEN_SOURCE or _GNU_SOURCE are defined then the GNU libc implementation falls back to the POSIX one.

could you please make a clean check out of gtk+ trunk, run the autogen.sh script and attach the resulting config.h to the bug? also the config.log would be helpful.
Comment 2 Jens Granseuer 2007-06-04 21:16:25 UTC
Created attachment 89357 [details]
config.h

This was built from the 2.11.1 tarball.
Comment 3 Jens Granseuer 2007-06-04 21:17:07 UTC
Created attachment 89358 [details]
config.log
Comment 4 Emmanuele Bassi (:ebassi) 2007-06-05 09:48:10 UTC
the configure script correctly defines HAVE_FTW_H and undefs HAVE_GNU_FTW, so you should have the definitions for nftw(), struct FTW and FTW_PHYS. this is very strange. I've noticed you're using linux 2.4.x - which version of libc is that you're using?
Comment 5 Jens Granseuer 2007-06-05 09:52:07 UTC
glibc is 2.2.3 (yeah, I know...)
Comment 6 Emmanuele Bassi (:ebassi) 2007-06-05 10:08:45 UTC
could you cook up a patch to detect such changes? thanks.
Comment 7 Jens Granseuer 2007-06-05 17:29:31 UTC
Would there be any problems simply defining _XOPEN_SOURCE unconditionally?
Comment 8 Emmanuele Bassi (:ebassi) 2007-06-05 18:38:50 UTC
Created attachment 89427 [details] [review]
[PATCH] Unconditionally define GNU libc symbols in GtkSearchEngineSimple


Really old GNU libc versions have ftw.h but export POSIX ftw() and
friends only if _XOPEN_SOURCE and _GNU_SOURCE are defined. See
bug 444097.
---
 gtk/gtksearchenginesimple.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
Comment 9 Emmanuele Bassi (:ebassi) 2007-06-05 18:41:09 UTC
I'd like to get this tested on other platforms, before committing it: we added checks to avoid breaking compilation, I'd hate to break it while trying to unbreak it. :-)

Jens: you can confirm the patch above makes everything work for you, right?
Comment 10 Jens Granseuer 2007-06-05 19:54:13 UTC
(In reply to comment #9)
> Jens: you can confirm the patch above makes everything work for you, right?

Yes, although I don't actually need the _GNU_SOURCE.
Comment 11 Emmanuele Bassi (:ebassi) 2007-06-10 17:25:24 UTC
2007-06-10  Emmanuele Bassi  <ebassi@gnome.org>

        * gtk/gtksearchenginesimple.c: Unconditionally define _GNU_SOURCE
        and XOPEN_SOURCE, in order to make the simple search engine backend
        build on really ancient GNU libc. (#444097)