Skip to contentSkip to conversation

Adjusting SmPL script “tests/nest3.cocci”?

Cocci Markus Elfring 2 participants 2 messages Sep 11, 2019

lore
Share & tools
lore
#0 lore raw

Hello,

I have taken another look at a script for the semantic patch language.
https://github.com/coccinelle/coccinelle/blob/560c3d02e2085e83e9bcd40842eec7e774140131/tests/nest3.cocci

Can the following code variant be a bit nicer?
(Would you like to avoid the message “warning: rule starting on line 1:
metavariable func not used in the - or context code”?)

@@
identifier f, i;
@@
- int i;
<... when != i
- for (i = ...; i < ...; i++) f(...);
+ f(1);
...>

Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

#1 lore raw
Quoted 8 lines · Markus Elfring

Hello,

I have taken another look at a script for the semantic patch language.
https://github.com/coccinelle/coccinelle/blob/560c3d02e2085e83e9bcd40842eec7e774140131/tests/nest3.cocci

Can the following code variant be a bit nicer?
(Would you like to avoid the message “warning: rule starting on line 1:
metavariable func not used in the - or context code”?)

I have dropped the declaration of the metavariable.

julia

Quoted 11 lines

@@
identifier f, i;
@@
- int i;
<... when != i
- for (i = ...; i < ...; i++) f(...);
+ f(1);
...>

Quoted 7 lines

Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci