









|
[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
[NMLUG] gcc pre-defined macros
Michael Maddex wrote:
>
> Aaron Birenboim wrote:
>
> > I remember once apon a time, I found a way to list
> > all the pre-defined macros from gcc. It was like
> > several PAGES long. Things like: __unix, __linux__,
> > i386, __i386, __STDC__, LITTLE_ENDIAN....
> >
> > I'm having a devil of a time remembering how I did that.
> > And... I NEED it again. Could anybody give me hint
> > about how to get such a list again?
>
> Are you looking for something like this? This show the defaults when
> gcc is invoked.
>
> $ echo 'main(){printf("hello world\n");}' | gcc -E -v -
> Reading specs from /usr/lib/gcc-lib/i486-box-linux/2.7.2/specs
> gcc version 2.7.2
> /usr/lib/gcc-lib/i486-box-linux/2.7.2/cpp -lang-c -v -undef
> -D__GNUC__=2 -D__GNUC_MINOR__=7 -D__ELF__ -Dunix -Di386 -Dlinux
> -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__i386
> -D__linux -Asystem(unix) -Asystem(posix) -Acpu(i386)
> -Amachine(i386) -D__i486__ -
This is just a small subset of what is REALLY defined.
I don't remember how to get at the rest.
Some of the macros I KNOW are defined, but not on
the above list are:
LITTLE_ENDIAN
__STDC__
Where do I get the rest of that defined list?
Are all the other macros from the system include files?
There must be an easier way to find them than reading
all the system includes.... i hope!
> The above pasted from the GCC-HOWTO.
>
> Also I think that
>
> $ info gcc
>
> will list and describe all of the pre-defines, but that's a large
> collection of files and I don't remember exactly where to start looking,
> but I believe the list is near the beginning.
Its probobally there.... but I haven't found it yet...
--
Aaron Birenboim \ If you must choose between two evils,
Albuquerque, NM \ pick the one you've never tried before.
www.swcp.com/~aaron \
aaron@ptree.abq.nm.us\ -Steven Wright
------------------------------------------------------
To UNSUBSCRIBE send a message to nmlug-request@swcp.com
with only the word unsubscribe in the body. More
information can be found at www.nmlug.org/info.html
-----------------------------------------------------
|
|