From: Markus Elfring <Markus.Elfring@web.de>
To: cocci@inria.fr
Subject: [cocci] Avoiding duplicate elements in SmPL disjunctions?
Date: Sat, 8 Nov 2025 10:50:38 +0100 [thread overview]
Message-ID: <228c50a2-bb15-4abe-bef9-b0f9b95f6992@web.de> (raw)
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
next reply other threads:[~2025-11-08 9:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-08 9:50 Markus Elfring [this message]
2025-11-22 10:35 ` [cocci] Avoiding duplicate elements in SmPL disjunctions? Markus Elfring
[not found] ` <188e41fa-91c5-b09c-51d1-8f69f5d8cea@inria.fr>
2025-11-22 14:54 ` Markus Elfring
2025-11-23 10:00 ` Markus Elfring
[not found] ` <c23ff4fa-b44e-f653-8015-9c573ae2ad47@inria.fr>
2025-11-23 10:15 ` Markus Elfring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=228c50a2-bb15-4abe-bef9-b0f9b95f6992@web.de \
--to=markus.elfring@web.de \
--cc=cocci@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).