On Wed, 29 Oct 2014, Jean-Sébastien Pédron wrote:

> On 29.10.2014 11:26, Julia Lawall wrote:
> >> I wanted to be able to re-run spatch on an already patched content. The
> >> use case is to add new function prototypes manually and run spatch to
> >> handle the associated #define automatically.
> >
> > I think that you could do the following:
> >
> > @r@
> > identifier func;
> > @@
> > #define        func    BAR(func)
> >
> > @s@
> > identifier r.func;
> > position p;
> > @@
> >
> > func@p(...) {...}
> >
> > @@
> > identifier func;
> > position p != s.p;
> > @@
> >
> > +#define        func    BAR(func)
> > func(...) { ... }

Sorry, typo here.  It should be func@p(...) { ... }

What is more unpleasant is that at least in my version of Coccinelle, it
indents the function definition.

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

Reply via email to