[cocci] Avoiding duplicate elements in SmPL disjunctions?
Markus Elfring <[email protected]>
| Newsgroups | fr.inria.cocci |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I tried the following script variant out for the semantic patch language.
@display@
statement s;
@@
*while (1)
s
Questionable test result (according to the software combination “Coccinelle 1.3.0”):
Markus_Elfring@Sonne:…/Projekte/Coccinelle/janitor> /usr/bin/spatch --parse-cocci show_unlimited_while_loops.cocci
…
(
*while *(*1*)
|
*while *(*1 *!= *0*)
|
*while *(*1*)
|
*while *(*0 *!= *1*)
)s
…
An element of the generated SmPL disjunction got repeated somehow.
How do you think about to avoid such duplicate code?
Regards,
Markus