C++ vs. AIX -ansi

David Edelsohn dje@watson.ibm.com
Tue Feb 6 11:10:00 GMT 2001


>>>>> 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


More information about the Libstdc++ mailing list