<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - False positive on loop with complex condition"
href="http://llvm.org/bugs/show_bug.cgi?id=22726">22726</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>False positive on loop with complex condition
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.5
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Static Analyzer
</td>
</tr>
<tr>
<th>Assignee</th>
<td>kremenek@apple.com
</td>
</tr>
<tr>
<th>Reporter</th>
<td>rino4work@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=13957" name="attach_13957" title="False positive case">attachment 13957</a> <a href="attachment.cgi?id=13957&action=edit" title="False positive case">[details]</a></span>
False positive case
Analyzer reports garbage for initialized variable:
clang --analyze -Xanalyzer -analyzer-output=text source.c
source.c:18:18: warning: The left operand of '!=' is a garbage value
if(result[i] != 0)
~~~~~~~~~ ^
source.c:6:14: note: Assuming 'i' is >= 'count1'
for(i = 0; i < count1; i++)
^~~~~~~~~~
source.c:6:3: note: Loop condition is false. Execution continues on line 11
for(i = 0; i < count1; i++)
^
source.c:11:3: note: Loop condition is false. Execution continues on line 16
for(i = count1; i < count2; i++)
^
source.c:16:3: note: Loop condition is true. Entering loop body
for(i = 0; i < count1 + count2; i++)
^
source.c:18:18: note: The left operand of '!=' is a garbage value
if(result[i] != 0)
~~~~~~~~~ ^
1 warning generated.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>