Re: [3/3] Coccinelle: pci_free_consistent: Extend when constraints for two SmPL ellipses

From: Markus Elfring
Date: Wed May 15 2019 - 02:50:34 EST


> 1, "id = (T2)(e)" is rare.

I can follow this view for such a filter.


> It may be a minor detail that will have no impact in practice.

I suggest to reconsider this view once more.

Should such exclusion specifications take also âunexpectedâ source code
into account so that analysis results will be presented with a low
false positive rate?


> We've tested it, and this SmPL may only need to fix the following two false positives:

Thanks for your acknowledgement that my proposal can give us
another useful effect.


> 2, If you really plan to add the two restrictions above,
> you may need to consider this further than simply adding a "when != id = (T2)(e)" statement.
> I constructed the flollowing code snippet as a test case:
â
> Using the original SmPL, we can find a bug.

I observe on my system that I do not get a desired warning
by the software combination âCoccinelle 1.0.7-00186-g99e081e9 (OCaml 4.07.1)â
(even from the unmodified SmPL script) for your test example.

Which version are you using for the spatch program?


> But with your modified SmPL, we can't find the bug.

I do not see a difference here. - I wonder also about this situation then.

But this gives us the opportunity to clarify the really desired
software behaviour in more detail.
How many developers would like to help with additional insights?

Regards,
Markus