Re: Feature request - a macro defined for GCC

Top Page

Reply to this message
Author: Andrew Haley
Date:  
To: x z
CC: gcc
Subject: Re: Feature request - a macro defined for GCC
x z wrote:

> I would like to see that GCC define a macro in the case it is being
> used to compile a program. Currently there is a __GNUC__ macro
> defined by the GNU C preprocessor CPP. That does not suit the need.
> As the CPP Manual says: __GNUC__ is "defined by all GNU compilers
> that use the C preprocessor". It seems to imply that any (non-GNU)
> compiler that uses the GNU C preprocessor would also have __GNUC__
> defined. According to their respective manuals, Intel C++ Compiler
> and Portable C Compiler also pre-define __GNUC__, possibly because
> they use the GNU CPP.


They don't use GNU CPP.

> Therefore, the fact that __GNUC__ is defined does not necessarily
> mean the GCC compiler proper is being used.


I don't think you've thought about this thoroughly.

Any compiler that is not GNU C but defines __GNUC__ is lying to its
users. If we define __REAL_GNUC__ they'll just define that as well.

Andrew.