[LLVMbugs] [Bug 23487] New: Custom assert function is not registered as 'noreturn'

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon May 11 21:56:13 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=23487

            Bug ID: 23487
           Summary: Custom assert function is not registered as 'noreturn'
           Product: clang
           Version: 3.5
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: evanbenn at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 14312
  --> https://llvm.org/bugs/attachment.cgi?id=14312&action=edit
scan-build gcc -c clang-test-3.c finds a bug with this code.

I have a custom assert function that checks a value, prints some information,
and calls abort. (it does not call assert). 

I believe this is due to a function using a variable argument list. If I mark
the variable argument function __attribute__((__noreturn__)) then the 'assert'
is correctly identified. If I mark the abort function (called by the variable
argument function) with __attribute__((__noreturn__)) then the 'assert' is not
identified, and clang finds a bug with NULL pointer dereference.

I expect: scan-build to find no NULL pointer dereference
I get: scan-build does not recognise the abort(), and finds a NULL pointer
dereference.

I am on Ubuntu clang-3.5

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150512/a9c0ba20/attachment.html>


More information about the llvm-bugs mailing list