SV: [Cocci] Macro parsing without ;

Julia Lawall julia at diku.dk
Mon Nov 30 10:01:52 CET 2009


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...

Could you try #define HEADER(head) MACROSTATMENT ?  I think that is the 
way to handle this sort of thing.  You can see many examples in 
standard.h.

If that doesn't help, I can look at it more this afternoon.

julia


More information about the Cocci mailing list