This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Feature request - a macro defined for GCC


Vincent Lefevre:
[ Charset ISO-8859-1 converted... ]
> On 2008-07-01 11:11:42 -0700, Ian Lance Taylor wrote:
> > __GNUC__ is indeed defined by the compiler proper, not by the
> > preprocessor.
> 
> What do you mean here?
> 
> Even when calling the preprocessor directly, __GNUC__ is defined:
> 
> vin% gcc -dM -E -xc /dev/null | grep __GNUC__
> #define __GNUC__ 4
> vin% cpp -dM /dev/null | grep __GNUC__
> #define __GNUC__ 4
> 
> > But that in turn does not matter, as if any non-gcc compiler *did* use
> > the gcc preprocessor, it would do so via gcc -E.  In gcc, the
> > preprocessor is not a separate program.
> 
> But in any case, there's a separate preprocessor: cpp. And perhaps cpp
> shouldn't define __GNUC__.
> 
> (BTW, this isn't a compiler, but xrdb uses cpp by default.)

Try:

$ echo ' ' | cpp -undef -dM -

and determine if there's any output (varies by platform).

The ctpp preprocessor undefines all builtins when -undef is present.  See the 
URL below (plug, I know).

-- 
Ctalk Home Page: http://www.ctalklang.org


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]