On Mon, 3 Aug 2020, 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; Only if the C code is able to be parsed (note that you could have tested this instead of expecting something). It's not well defined whether something is an attribute or not. Coccinelle has some heuristics for that. But even if the declaration is completely useless, I also don't care. It's one line in a test case. It hurts nothing. Much more time has been wasted on this discussion than on any confusion that line would cause. > > > 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; > ) > … > > 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”). I'm not sure why the whole declaration became removed. Thanks for the report. julia