[LLVMbugs] [Bug 8914] New: __dead2 not respected

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jan 5 07:57:44 PST 2011


http://llvm.org/bugs/show_bug.cgi?id=8914

           Summary: __dead2 not respected
           Product: clang
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: erik at cederstrand.dk
                CC: llvmbugs at cs.uiuc.edu


FreeBSD run the analyzer regularly on our source code. The scan reports contain
many false positives caused by the analyzer not knowing that a call to e.g.
errx() or exit() doesn't return. Instead it proceeds to find e.g. a bogus null
dereference. Examples:

http://scan.freebsd.your.org/freebsd-head/usr.sbin.jail/2011-01-05-amd64/report-W2zjAu.html#EndPath:
Step 12 (line 192) calls usage() (line 552) which in turn calls exit()
http://scan.freebsd.your.org/freebsd-head/usr.sbin.pw/2011-01-05-amd64/report-KkilQ3.html#EndPath:
Step 6 (line 167) calls cmdhelp() (line 285) which in turn calls exit()

Many such functions in FreeBSD are marked with "__dead2" to indicate that the
function never returns (e.g. exit() in
http://svn.freebsd.org/viewvc/base/head/include/stdlib.h?revision=206997&view=markup
and errx() in
http://svn.freebsd.org/viewvc/base/head/include/err.h?revision=203964&view=markup).

If the analyzer was able to find and honour this flag we would be able to
ignore a huge number of false positive reports, increasing the value of the
reports.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list