[LLVMbugs] [Bug 9828] False positive for null function pointer call following assert()

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon May 2 10:59:51 PDT 2011


Ted Kremenek <kremenek at apple.com> changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
                 CC|                            |kremenek at apple.com
         Resolution|                            |INVALID

--- Comment #1 from Ted Kremenek <kremenek at apple.com> 2011-05-02 12:59:51 CDT ---
Looks like 'assert' is not defined, and the compiler is treating it as an
undeclared function.  This is the warning I see from clang (the compiler):

ca-bug1.c:8:3: warning: implicit declaration of function 'assert' is invalid in
C99 [-Wimplicit-function-declaration]
  assert(func != NULL);

This means your assert() isn't actually doing what you think it is.


#include <assert.h>

On the Mac, that causes 'assert' to be defined correctly and the false path
goes away.

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