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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to