This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Feature request - a macro defined for GCC
- From: rkiesling <rkiesling at earthlink dot net>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 2 Jul 2008 11:26:41 -0400 (EDT)
- Subject: Re: Feature request - a macro defined for GCC
- Reply-to: ctalk at ctalklang dot org
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