On Mon, 2020-08-03 at 07:37 +0200, Markus Elfring wrote:
> > > Do you care if a SmPL name variable would accidentally not be
> > > used
> > > (like in the script “
> > > https://github.com/coccinelle/coccinelle/blob/04f36d537b9f6c0c127d05184cccd21f1a46b952/tests/metaattr.cocci#L2”
> > > )?
> > 
> > It actually is used, to help parsing the .c file.  This information
> > will
> > be added to the documentation shortly.
> 
> I would expect that the following SmPL script variant will generate
> also a patch.
> (Why would extra “help” be needed for parsing source files?)
> 
> @replacement@
> attribute a;
> identifier b;
> @@
> -int
> +char
>  b a = 1;
> 
> 
> By the way:
> I have noticed another detail which I find questionable at the
> moment.
> 
> elfring@Sonne:~/Projekte/Coccinelle/20160205> spatch --parse-cocci
> tests/metaattr-2.cocci
> …
> (
> -int
>   >>> char
>  b a = 1;
> -signed
>   >>> char
> -int b a = 1;
> )
> …
> 

Probably a pretty printing mistake. I'll fix this.

Thanks,
Jaskaran.

> I would interpret the display for the second part of such a SmPL
> disjunction
> in the way that a variable definition will be deleted (instead of
> taking only
> the key word “signed” also into account according to the isomorphism
> “add_signed”).
> 
> Regards,
> Markus

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

Reply via email to