[cfe-commits] [cfe-dev] How to fix null-deref-ps.c on FreeBSD?

Ted Kremenek kremenek at apple.com
Tue Feb 17 09:43:54 PST 2009

On Feb 17, 2009, at 9:37 AM, Ben Laurie wrote:

> On Tue, Feb 17, 2009 at 4:45 PM, Ted Kremenek <kremenek at apple.com>  
> wrote:
>> Hi Ben,
>> The analyzer knows that all functions with the 'noreturn' attribute  
>> don't
>> return.  What does the assert macro expand to on FreeBSD?
> The problem is that __assert does not have noreturn set on FreeBSD.
> I'm in the process of getting that fixed - but as an apprentice
> FreeBSD committer that's probably harder for me than anyone else, so
> it may take a while :-)
> In the meantime, I think the right answer is for me to patch
> /usr/include/assert.h.

__assert isn't the only "panic" function that isn't marked with  
noreturn.  Since it occurs so frequently, I can just add it to the  
list of hard-coded functions that the analyzer knows about.  That will  
also make the analyzer more applicable to earlier versions of FreeBSD  
(should you want to see how far a bug goes back, for example).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20090217/41d34c79/attachment.html>

More information about the cfe-commits mailing list