Skip to content

Misleading "operand is always zero" message #9875

@llvmbot

Description

@llvmbot
Bugzilla Link 9503
Resolution FIXED
Resolved on Mar 17, 2011 16:28
Version unspecified
OS MacOS X
Reporter LLVM Bugzilla Contributor
CC @tkremenek

Extended Description

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions