Disable GNU defines in Clang?

Hi All,

I want to disable Clang defining __GNUC__ and friends. Its causing a
few problems in a couple of projects I'm interested in. In addition,
its causes problems in other's work (confer,

$ clang -dM -E -x c /dev/null | grep -i gnu
#define __GNUC_MINOR__ 2
#define __GNUC_PATCHLEVEL__ 1
#define __GNUC_STDC_INLINE__ 1
#define __GNUC__ 4
#define __gnu_linux__ 1

I've been through http://clang.llvm.org/docs/UsersManual.html, and I
don't see an option to request the behavior.

Is there any way to instruct Clang to *not* define GNUC, GNUC_MINOR,


You could always use something like -U__GNUC_MINOR__ on the command line for each of the defines? It’s a bit of a hack workaround, but…