[cfe-dev] Clang++ always defines _GNU_SOURCE

Lei Zhang via cfe-dev cfe-dev at lists.llvm.org
Tue Jun 14 01:40:50 PDT 2016


Hi,

I noticed that clang++ unconditionally defines _GNU_SOURCE on Linux,
even when I'm not including any headers in my code. Switching from
stdlibc++ to libc++ doesn't change this, either.

I understand that g++ does this because stdlibc++ heavily relies on
_GNU_SOURCE. But what is the reason for clang++ to do so when using
libc++? Does libc++ also rely on this macro to work on Linux?


Regards,
Lei



More information about the cfe-dev mailing list