On Fri, 7 Jun 2019, Markus Elfring wrote:
> > but not:
> >
> > @@
> > @@
> >
> > - #ifdef FOO
> > bar();
> > - #endif
>
> The deletion of these preprocessor statements is not directly supported
> in the shown way by the Coccinelle software at the moment.
> But I got another code transformation idea which would not be so convenient.
>
> The semantic patch language supports the metavariable type “statement list”
> for a while.
> https://github.com/coccinelle/coccinelle/blob/cad4c0705f9e37f501531e133d3a47bc56ed0ce2/docs/manual/cocci_syntax.tex#L209
>
> I imagine then that the function call can be “intentionally” deleted
> and added back in such a simple SmPL script example.
>
> * Should any extra C code vanish after such a special adjustment
> because specific parts were not restored?
>
> * Can it make sense here to change a bit of code even if it was originally
> intended to keep it untouched?
>
>
> Will similar software updates become more challenging for the initially
> described handling of designated initialisers for known data structures?
This is in the spirit of the solution I already proposed. The original
issue was about structure field initializations, not statements, so
statement list is not appropriate.
julia
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci