[LLVMbugs] [Bug 13673] New: false positive: division by zero with unsigned denominator

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Aug 22 19:43:10 PDT 2012


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

             Bug #: 13673
           Summary: false positive: division by zero with unsigned
                    denominator
           Product: clang
           Version: 3.1
          Platform: PC
        OS/Version: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: marka at isc.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 9098
  --> http://llvm.org/bugs/attachment.cgi?id=9098
division by zero false positive example code.

The following attachment produces a false positive for division by zero if 'b'
is declared to be 'unsigned int' but no warning is generated if 'b' is declared
to be 'int'. 


> clang --analyze cc.c
cc.c:18:8: warning: Division by zero
        c = a / b[i];
            ~~^~~~~~
1 warning generated.
> clang --version
clang version 3.1 (branches/release_31)
Target: i386-portbld-freebsd8.3
Thread model: posix
>

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