This is the mail archive of the
mailing list for the GCC project.
Fixed build failure on Linux in cppfiles (_XOPEN_SOURCE is evil)
- To: gcc-patches at gcc dot gnu dot org
- Subject: Fixed build failure on Linux in cppfiles (_XOPEN_SOURCE is evil)
- From: Andreas Jaeger <aj at suse dot de>
- Date: 16 Sep 2000 09:43:01 +0200
- Cc: Tom Tromey <tromey at cygnus dot com>
With the current (it worked 24 hours ago) gcc from CVS I get:
/cvs/gcc/gcc/cppfiles.c: In function `read_include_file':
/cvs/gcc/gcc/cppfiles.c:277: warning: implicit declaration of function `getpagesize'
/cvs/gcc/gcc/cppfiles.c: In function `purge_cache':
/cvs/gcc/gcc/cppfiles.c:367: `caddr_t' undeclared (first use in this function)
/cvs/gcc/gcc/cppfiles.c:367: (Each undeclared identifier is reported only once
/cvs/gcc/gcc/cppfiles.c:367: for each function it appears in.)
/cvs/gcc/gcc/cppfiles.c:367: parse error before `inc'
/cvs/gcc/gcc/cppfiles.c:366: warning: empty body in an if-statement
/cvs/gcc/gcc/cppfiles.c:367: warning: left-hand operand of comma expression has no effect
/cvs/gcc/gcc/cppfiles.c:367: parse error before `)'
The problem is this patch:
2000-09-15 Tom Tromey <firstname.lastname@example.org>
* configure, config.in: Rebuilt.
* configure.in: Check for iconv.h. Define _XOPEN_SOURCE.
The definition of _XOPEN_SOURCE on a glibc 2.1. based systems hides
getpagesize and caddr_t since both are BSD features. We should either
define also _GNU_SOURCE or _BSD_SOURCE. I just defined _GNU_SOURCE in
auto-host.h and it seemed to work (full bootstrapp currently on its
Here's a patch to use _XOPEN_SOURCE and _GNU_SOURCE. This should also
avoid these warnings:
/cvs/gcc/gcc/gcc.c:2456: warning: implicit declaration of function `fputc_unlocked'
I'm running make bootstrap and the testsuite on i686-linux with glibc
2.1.3 now. Ok to commit if it bootstraps?
2000-09-16 Andreas Jaeger <email@example.com>
* configure.in: Always define _GNU_SOURCE to make interfaces
visible that were hidden by only defining _GNU_SOURCE.
--- configure.in 2000/09/15 22:05:48 1.418
+++ configure.in 2000/09/16 07:37:13
@@ -423,6 +423,9 @@
# Always define _XOPEN_SOURCE. It doesn't hurt, and it lets us
# pick up CODESET from langinfo.h, among other things.
AC_DEFINE(_XOPEN_SOURCE, 1, [Always define this])
+# If we define _XOPEN_SOURCE on a glibc2 system, it hides other
+# interfaces. Make them visible again with _GNU_SOURCE.
+AC_DEFINE(_GNU_SOURCE, 1, [Always define this])
# See if GNAT has been installed
AC_CHECK_PROG(gnat, gnatbind, yes, no)
SuSE Labs firstname.lastname@example.org