On Fri, 7 Jun 2019, Enrico Weigelt, metux IT consult wrote:
> On 06.06.19 11:39, Julia Lawall wrote:
>
> >> See also:
> >> https://github.com/coccinelle/coccinelle/blob/cad4c0705f9e37f501531e133d3a47bc56ed0ce2/docs/manual/cocci_syntax.tex#L1765
> >
> > To be less cryptic, Coccinelle supprorts matching and transformation for
> > #include and #define, and addition of comments pragmas and ifdefs.
>
> Could you perhaps give an quick example for a newbie ?
You can do:
@@
@@
+ #ifdef FOO
bar();
+ #endif
but not:
@@
@@
- #ifdef FOO
bar();
- #endif
You can also do
@@
expression e;
@@
- #define XXX e
or various other things that you may expect to be able to do with #define.
julia
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci