This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: C++ vs. AIX -ansi
- To: Mike Stump <mrs at windriver dot com>
- Subject: Re: C++ vs. AIX -ansi
- From: David Edelsohn <dje at watson dot ibm dot com>
- Date: Tue, 06 Feb 2001 14:08:27 -0500
- cc: mark at codesourcery dot com, gcc at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
>>>>> Mike Stump writes:
Mike> If g++ needs certain features of the library, then it should turn on
Mike> the #define's itself on those platforms. If it does it, then it will
Mike> be early enough.
Mike> Also, one could autoconf the existence of this type of bizarreness and
Mike> automagically include the #define. This could even be done in the
Mike> library with a forwarding #include that merely #defines the right
Mike> thing, and then #include_next's the real header.
I guess that autoconf might be able to figure this out.
Remember that the problem is, for example, libio/fileops.c whose
first lines are:
#ifndef _POSIX_SOURCE
# define _POSIX_SOURCE
#endif
before any header files are included. AIX and Irix and others define the
macros in header files, not in the compiler. The above logic assumes that
any macros will be defined before any headers, so it enables macros it
knows it requires if they are not already defined. This conflicts with
the various OS's logic for getting the right macros defined. (One can
look at the last religious argument about this for people's opinions on
which ay is right.)
As I mentioned in one of the earlier notes, now that libstdc++-v3
is not using libio, the extra macros in os_defines.h to avoid the
_POSIX_SOURCE conflict but which *do* conflict with g++ -ansi might not be
necessary.
David