> 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?

Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to