[Cocci] Neater way to write this...

Julia Lawall julia at diku.dk
Wed Nov 2 21:30:29 CET 2011


> The next thing I want to do is add a call to setup_restart() to each of
> the arch_reset() functions.  I've not yet found a way to tell coccinelle
> to add the call after any local variable declarations.  My last try was:
> 

Try:

@@
identifier m, c;
statement S1,S2
@@
arch_reset(char m, const char *c)
{
... when != S1
+setup_restart(m);
S2
...
}

S1 only matches a statement, not a declaration.  S2 is representing the
first statement in the function.

julia


More information about the Cocci mailing list