This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Should _GNU_SOURCE be defined always?
- From: Carlo Wood <carlo at alinoe dot com>
- To: gcc at gcc dot gnu dot org
- Date: Sun, 17 Feb 2002 15:15:27 +0100
- Subject: Should _GNU_SOURCE be defined always?
The following program:
---
#define _GNU_SOURCE
---
Gives different results with different compilers:
>g++-2.95.3 -c test.cc -o test.o
>g++-3.0 -c test.cc -o test.o
>g++-3.0.1 -c test.cc -o test.o
>g++-3.0.2 -c test.cc -o test.o
>g++-3.0.3 -c test.cc -o test.o
test.cc:1:1: warning: "_GNU_SOURCE" redefined
<command line>:1:1: warning: this is the location of the previous definition
>g++--3.0.4 -c test.cc -o test.o
test.cc:1:1: warning: "_GNU_SOURCE" redefined
<command line>:1:1: warning: this is the location of the previous definition
In other words, as of 3.0.3 _GNU_SOURCE is suddenly already
defined by the compiler.
Can I count on it that it will stay defined in all future versions?
--
Carlo Wood <carlo@alinoe.com>