On Thu, 27 Mar 2014, SF Markus Elfring wrote:

> > Not sure what you mean by extended.  There are indeed some other functions
> > in Linux that perform NULL tests before doing anything, and thus they
> > don't really need a null test around them.
>
> I have got another concern for a corresponding implementation detail.
> How can a constraint be specified for the filter in the semantic patch
> so that the expression refers only to non-volatile data?
> Is it a software development challenge to exclude accesses on volatile
> data elements eventually from the suggested deletion of condition checks?
> https://en.wikipedia.org/wiki/Volatile_variable#In_C_and_C.2B.2B

Perhaps it is possible to write:

@@
volatile x;
@@

* x == NULL

Or maybe

@@
type T;
volatile T x;
@@

* x == NULL

Or at worst:

@@
type T;
identifier i;
@@

volatile T i;
...
*i == NULL

I don't know if this would find much.  Intuitively, one might expect such
problems to be detected easily by testing or developers to know better in
thw first place, but who knows.

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

Reply via email to