* [Cocci] Adjusting SmPL script “tests/nest3.cocci”? @ 2019-09-11 6:51 Markus Elfring 2019-09-11 8:28 ` Julia Lawall 0 siblings, 1 reply; 2+ messages in thread From: Markus Elfring @ 2019-09-11 6:51 UTC (permalink / raw) To: Coccinelle 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 Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Cocci] Adjusting SmPL script “tests/nest3.cocci”? 2019-09-11 6:51 [Cocci] Adjusting SmPL script “tests/nest3.cocci”? Markus Elfring @ 2019-09-11 8:28 ` Julia Lawall 0 siblings, 0 replies; 2+ messages in thread From: Julia Lawall @ 2019-09-11 8:28 UTC (permalink / raw) To: Markus Elfring; +Cc: Coccinelle [-- Attachment #1: Type: text/plain, Size: 773 bytes --] On Wed, 11 Sep 2019, Markus Elfring wrote: > 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 > > @@ > identifier f, i; > @@ > - int i; > <... when != i > - for (i = ...; i < ...; i++) f(...); > + f(1); > ...> > > > Regards, > Markus > _______________________________________________ > Cocci mailing list > Cocci@systeme.lip6.fr > https://systeme.lip6.fr/mailman/listinfo/cocci > [-- Attachment #2: Type: text/plain, Size: 136 bytes --] _______________________________________________ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-09-11 8:29 UTC | newest] Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2019-09-11 6:51 [Cocci] Adjusting SmPL script “tests/nest3.cocci”? Markus Elfring 2019-09-11 8:28 ` Julia Lawall
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).