Re: clang's static checker report. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: clang's static checker report.
Date
Msg-id 13898.1251649756@sss.pgh.pa.us
Whole thread Raw
In response to Re: clang's static checker report.  (Greg Stark <gsstark@mit.edu>)
List pgsql-hackers
Greg Stark <gsstark@mit.edu> writes:
> I think most of the remaining false positives are cases where palloc,
> palloc0, repalloc, MemoryContextAlloc, or MemoryContextAllocZero
> return values are deferenced. Clang doesn't know that these functions
> never return NULL so it's marking every case as a possible NULL
> dereference.

If clang assumes that every function that returns a pointer could return
NULL, then we are going to have many many many many false positives
at levels far removed from palloc.  I'd almost suggest that we look for
a way to reverse its default assumption about that.  Failing that,
I fear we shall simply have to ignore that particular message as
uselessly noisy.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: drop tablespace error: invalid argument
Next
From: Tom Lane
Date:
Subject: Re: clang's static checker report.