This is the mail archive of the gcc-help@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: CPP macro expansion


lrtaylor@micron.com writes:

> -----Original Message-----
> From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On 
> 
> > > I need to obtain a preprocessed C source output, the source
> > > code that will go to the gcc compiler proper, with all the macro
> > > functions expanded as declared with its multi line
> > > formatting/indentation
> > > and not as usual single long line. I need to check my final code
> before
> > > the full compilation.
> > > 
> > > Does anyone know how can I do ?
> > > Does the GNU CPP permit this ?
> 
> > No.
> 
> Not so.  Pass the -E option to gcc (or g++).  This will cause it to
> output the preprocessed source code:
> 
> gcc -E file.c

Maybe I misunderstood the question. I thought the problem was to get
from

#define F {      \
            bla; \
          }
F

to
{      
   bla;
}

whereas gcc -E produces

{ bla; }

-- 
	Falk


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