[Cocci] string parameter concatenation

Julia Lawall julia.lawall at lip6.fr
Thu Oct 2 15:37:33 CEST 2014


On Thu, 2 Oct 2014, Cyril Hrubis wrote:

> Hi!
> > Would it make sense and work to write a semantic patch rule like the following?
> > 
> > @replacement@
> > @@
> > -f
> > +g
> > (L);
> > 
> > 
> > Can the passed parameters be omitted from the desired adjustment by "the plus line"?
> 
> The whole rule that I'm working with is:
> 
> @@
> expression list L;
> expression C != {TINFO, TPASS};
> @@
> - tst_resm(C, L);
> - tst_exit();
> + tst_brkm(C, NULL, L);
> 
> Which is used to replace two functions with one and shuffles the
> arguments a bit.

It is not actually necessary to remove and add back L.  You could write:

- tst_resm
+ txt_brkm
   (C,
+   NULL,
    L);
- tst_exit();

However, it is useful to have the bug reports.

julia


More information about the Cocci mailing list