On Tue, 4 Dec 2018, Timur Tabi wrote:
> On Tue, Dec 4, 2018 at 4:02 PM Timur Tabi <[email protected]> wrote:
> > Based on what I've read, I need to add < > in order for spatch to run
> > the rule multiple times within a function. But if I change r4 to
> > this:
> >
> > @r4 depends on rules@
> > identifier func;
> > expression x;
> > constant char[] c;
> > @@
> > func(...) {
> > <...
> > NV_PRINTF2(x, c, ...)
> > ...>
> > }
> >
> > It doesn't work at all.
>
> Ok, I changed it to
>
> func(...) {
> <+...
> NV_PRINTF2(x, c, ...)
> ...+>
> }
>
> and now it works. I don't know why I needed the +'s, but at least it
> works now. Thanks.
This means that the rule only applies when there is at least one
occurrence of the pattern in between the <+... ...+>.
The previous rule matched all functions.
julia
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci