>>> It could be helpful to replace the last line by:
>>>
>>> (
>>> e3 = <+...var...+>
>>
>> Can this SmPL specification make sense as another when constraint?
>
> No.
I imagine that a few extensions like the following can become safer.
when != do ds while( \( var bo e3 \| var \) );
when != switch(var) { ... default: ... }
Unfortunately, the software combination “Coccinelle 1.0.7-00211-geaa13d59
(OCaml 4.07.1)”
does not like such an approach at the moment.
…
minus: parse error:
File
"/home/elfring/Projekte/Coccinelle/janitor/show_questionable_variable_initialisation3.cocci",
line 12, column 27, charpos = 295
around = '...',
…
If I try the specification “when != switch(var) { default: ... }” out,
the information “not supported” is provided.
> When is about the code between the code that matches what is before
> or after. If you put when, you will get a false positives for var = var + 1.
It seems that more analysis constraints should be taken into account finally.
I find also that it should be ensured then that metavariables like “e3” and
“var”
will refer to different source code.
Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci