Re: [cocci] Logical consequences for applications of SmPL conjunctions

Julia Lawall <[email protected]> Wed, 1 Apr 2026 06:59:11 -0400 (EDT)
Newsgroups fr.inria.cocci
Message-ID <[email protected]>

On Wed, 1 Apr 2026, Markus Elfring wrote:

> Would you find SmPL code (like the following) not so useful in comparison to
> indicated software functionality according to another published test case?
> https://gitlab.inria.fr/coccinelle/coccinelle/-/blob/03a1af0a3316ddfc2b54d827b8b9627a841c85c9/tests/andid.cocci
>
>
> @duplicate_metavariable_type@
> identifier x, y;
> @@
> (x
> &y
> )

Certainly it does not seem very useful.  But maybe there is some need to
have two names for the same thing.

In the test you refer to (that you could have easily included in the mail
instead of making me wait to have to load a link) the identifier
metavariables have different constraints, so the pattern is useful.

julia


>
>
> Regards,
> Markus
>