[LLVMbugs] [Bug 13735] New: Ordered comparison with pointer not detected

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Aug 31 00:14:41 PDT 2012


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

             Bug #: 13735
           Summary: Ordered comparison with pointer not detected
           Product: clang
           Version: 3.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: socketpair at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


--------------------------
int main (void)
{
  void *volatile qwe = main;

  if (qwe < 0)
    return 1;

  return 0;
}
--------------------------
$ gcc -Wall -Wextra zxc.c
zxc.c: In function 'main':
zxc.c:5:11: warning: ordered comparison of pointer with integer zero [-Wextra]
zxc.c:8:11: warning: comparison between pointer and integer [enabled by
default]
$ clang -Wall -Wextra --analyze zxc.c 
$ gcc --version
gcc-4.6.real (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
$ clang --version
Ubuntu clang version 3.0-6ubuntu3 (tags/RELEASE_30/final) (based on LLVM 3.0)
--------------------------
So, Clang does not detect very important bug in my code.

-- 
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