This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Question about feature test macros
- From: Ken Brown <kbrown at cornell dot edu>
- To: newlib at sourceware dot org
- Date: Mon, 25 Dec 2017 17:43:55 -0500
- Subject: Question about feature test macros
- Authentication-results: sourceware.org; auth=none
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