Re: [cocci] Checking data structure member accesses after function return value assignments?

Markus Elfring <[email protected]> Wed, 21 Jan 2026 16:12:25 +0100
Newsgroups fr.inria.cocci
Message-ID <[email protected]>
>> It seems that this source code search approach is “too simple” so far.
>> How would you like to improve it for the avoidance of unwanted false positives?
> 
> Lots of research papers have worked on this problem.

Such information sources are evolving.


>                                                       You can find the
> definition and see if it returns NULL.

* Would a corresponding lookup need a cross-reference?

* How do you think about the possibility to mark any functions (or macros)
  in a systematic way that they can fail?

* Will identifier lists become more interesting for knowledge representation accordingly?


>                                         YOu can find other calls to the
> function and see if they test for NULL.

Corresponding statistical analyses can become also interesting occasionally.


>                                          But you may always get false
> positives, because there may be some combinations of arguments that can
> never lead to a failure.

Can we know any programming interfaces better which can only succeed?

Regards,
Markus