SV: [Cocci] Macro parsing without ;

Julia Lawall julia at diku.dk
Mon Nov 30 10:39:26 CET 2009


On Mon, 30 Nov 2009, Nicolas Palix wrote:

> On Monday 30 November 2009 10:01:52 Julia Lawall wrote:
> > On Mon, 30 Nov 2009, Andreas.Aaen at tieto.com wrote:
> > 
> > > Ok.
> > > 
> > > With the example below. If I put:
> > > ---------
> > > #define HEADER(head) int head ;
> > > ---------
> > > I a macro.h file, then it works if I do:
> > > 
> > > spatch -macro_file_buildins macro.h -parse_c  test/testhead.c
> > > but not if I do a:
> > > spatch -macro_file macro.h -parse_c  test/testhead.c
> > > and neither if the exact same #define is present in the c file itself.
> > > 
> > > 1) So this means that none of the #defines in the c files are read?
> > > 
> > > 2) I didn't understand the difference between -macro_file and -macro_file_builtins
> > 
> > Me either...
> 
> AFAIK one of them adds some definitions to the standard.h while the other
> replaces all the definitions.

I don't think so.  I think it has to do with the degree to which the 
definition of the macro is taken into account when processing the code.
But I don't know more than that.

julia


More information about the Cocci mailing list