Is -D_XOPEN_SOURCE=500 necessary in gcc/config/sparc/sol2.h?
Gerhard Franke
Gerhard.Franke@mni.fh-giessen.de
Tue Jul 10 05:45:00 GMT 2001
Hello,
since I didn't get any answer to my mail "Compile problems with g++-3.0"
( http://gcc.gnu.org/ml/gcc-help/2001-07/msg00066.html ) from July 5th
I tried to figure out why g++-2.95.3 behaves differently to g++-3.0
in the handling of #include <sys/socket.h>.
In short:
gcc/config/sparc/sol2.h of gcc-3.0 defines CPLUSPLUS_CPP_SPEC to
-D_XOPEN_SOURCE=500 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 \
-D__EXTENSIONS__
while gcc-2.95.3 does not.
The -D_XOPEN_SOURCE=500 triggers the odd(?) behavior of g++ or the
C preprocessor described in my other mail by defining _XPG4_2 in
sys/feature_tests.h. This activates, for example, the
'#define connect __xnet_conect' line in sys/socket.h and from now on
the preprocessor replaces every occurrence of a connect string with
__xnet_connect.
Can I safely remove the -D_XOPEN_SOURCE=500 or replace it with some
other less offensive defines?
Gerhard
More information about the Gcc-help
mailing list