Expanding Macros

Stefan Bellon sbellon at sbellon.de
Sun Mar 19 12:51:30 PST 2006


Adam wrote:
> In message <4effdc11f5sbellon at sbellon.de>, Stefan Bellon wrote:

> > Adam wrote:
> > 
> > > Is there a way to show how macros expand when they go through the
> > > C preprocessor?
> > 
> > Use gcc -E.

> Hmm, I just get "linker input file unused because linking not done".
> :-(

When you normally do a

    gcc -c hellow.c

in order do compile your hello world program, now do the following
instead to see the code after the preprocessor has run over it:

    gcc -E hellow.c

In this output you can see how macros have been expanded.

-- 
Stefan Bellon




More information about the gcc mailing list