On 2/25/19 6:42 PM, Timur Tabi wrote:
> I have lots of code that looks like this:
> 
> #define MY_ITERATOR(x, y)  for (x=0; x<y; x++)
> 
> MY_ITERATOR(v, 20)
> {
>     printf("%i\n", v);
> }
> 
> Spatch chokes on this because it thinks MY_ITERATOR() should end with
> a semicolon:
> 
> ...
> bad:          MY_ITERATOR(v, 20)
> BAD:!!!!!     {
> bad:               printf("%i\n", v);
> ...
> 
> I tried specifying "--undefined MY_ITERATOR", but that did nothing.
For cases like that I've added a define to my macro file to be used with
--macro-file-builtins or --macro-file.
But I'm working on Wine so have to use my own macro file anyway so I'm
not relying on the one that comes with coccinelle.

bye
        michael
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to