Disable GNU defines in Clang?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Disable GNU defines in Clang?

Jeffrey Walton
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,
https://svn.boost.org/trac/boost/ticket/7473).

$ 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,
and GNUC_PATCHLEVEL?

Jeff
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Disable GNU defines in Clang?

Eric Christopher
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...

-eric


On Fri, Mar 1, 2013 at 1:47 PM, Jeffrey Walton <[hidden email]> wrote:
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,
https://svn.boost.org/trac/boost/ticket/7473).

$ 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,
and GNUC_PATCHLEVEL?

Jeff
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev