This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH/RFC] libstdc++'s tr1/cstdint vs. IRIX's stdint.h
- From: Rainer Orth <ro at TechFak dot Uni-Bielefeld dot DE>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: 20 Jul 2006 21:24:45 +0200
- Subject: Re: [PATCH/RFC] libstdc++'s tr1/cstdint vs. IRIX's stdint.h
- References: <Pine.LNX.4.44.0607181110360.5570-100000@www.eyesopen.com>
Roger Sayle <roger@eyesopen.com> writes:
> mips-sgi-irix6.5 currently fails to bootstrap due to an interesting
> interaction between libstdc++'s configure logic and IRIX's stdint.h
> header file.
>
> The catch is that the top of IRIX's /usr/include/stdint.h contain the
> problematic lines:
>
> #ifndef __c99
> #error This header file is to be used only for c99 mode compilations
> ...
> #endif
>
> It looks like its trying to avoid poluting the default namespace with
> int_fast16_t and friends, unless the user has requested ISO compatability.
>
> This, of course, means that <stdint.h> can't be used from C unless
> the user explicitly uses -std=gnu99 or similar command line option,
> c.f. http://gcc.gnu.org/ml/gcc-patches/2006-01/msg00139.html which
> was a similar fix for a libgfortran failure.
A similar issue affects libjava on IRIX 6.5, too: cf. PR libgcj/28190 and
http://gcc.gnu.org/ml/java-patches/2006-q3/msg00083.html
(which hasn't received any reaction whatsoever).
> The unanticipated interaction in the libstdc++, is that configure
> first tests whether <stdint.h> is available using a C compiler but
> without -std=gnu99, which therefore fails on IRIX, but later in the
> same configure script tests "checking for ISO C99 support to TR1 in
> <stdint.h>" using the g++ compiler, which confusingly returns true.
> The irix backend of the g++ compiler, defines "__c99" by default.
True: this was done to enable use of ISO C99 functions in libstdc++. See
the thread starting at
http://gcc.gnu.org/ml/gcc-patches/2003-02/msg01367.html
> I'm not really sure the best way to fix this. Conceptually, it would
> make sense of libstdc++ to use the C++ compiler to detect whether headers
> are available. Unfortunately, my autoconf-foo isn't clever enough for
It may be necessary to check both with the C and C++ compilers, since there
are a few .c files in libmath, which would need -std=c99 (or gnu99) if they
include <stdint.h>. I haven't checked this yet.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University