[LLVMbugs] [Bug 9503] New: Misleading "operand is always zero" message

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Mar 17 14:24:56 PDT 2011


           Summary: Misleading "operand is always zero" message
           Product: clang
           Version: unspecified
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: randy.meadows at not-pc.com
                CC: llvmbugs at cs.uiuc.edu

On this code:

for (i=0; i < length; i += 3) {
   for (j = i; j < (i + 3); j++) {

the analyzer complains:

The left operand to '+' is always 0
1. The value 0 is assigned to 'i'
2. The left operand to '+' is always 0

talking about the expression (i + 3).  It doesn't seem to understand that the
variable i is going to be changed in a loop.

This is using the "Build & Analyze" function of Xcode v3.2.6.

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