This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]