This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Is -D_XOPEN_SOURCE=500 necessary in gcc/config/sparc/sol2.h?
- To: gcc-help at gcc dot gnu dot org
- Subject: Is -D_XOPEN_SOURCE=500 necessary in gcc/config/sparc/sol2.h?
- From: Gerhard Franke <Gerhard dot Franke at mni dot fh-giessen dot de>
- Date: Tue, 10 Jul 2001 14:45:06 +0200
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