Question about feature test macros

Ken Brown kbrown@cornell.edu
Tue Dec 26 04:34:00 GMT 2017


I was under the impression that 'g++ -std=gnu++11' would enable GNU 
extensions, but that doesn't seem to be the case.  Here's a test on Cygwin:

$ cat temp.cc
#include <stdlib.h>

$ g++ -std=gnu++11 -E -dD temp.cc | grep GNU_VISIBLE
#define __GNU_VISIBLE 0

It seems that I have to explicitly define _GNU_SOURCE, even though I've 
used -std=gnu++11:

$ g++ -std=gnu++11 -D_GNU_SOURCE -E -dD temp.cc | grep GNU_VISIBLE
#define __GNU_VISIBLE 1

Is this a bug, or am I misunderstanding '-std=gnu++11'?

Ken



More information about the Newlib mailing list