<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 --- - Detect unnecessary postfix ++ or --"
href="http://llvm.org/bugs/show_bug.cgi?id=21908">21908</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Detect unnecessary postfix ++ or --
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</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>legalize@xmission.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>In code like this:
1: i = 32767 + read_help_topic(INTRO_AUTHORS, 0, 32767, screen_text);
2: screen_text[i++] = '\0';
3: i = 32767 + read_help_topic(INTRO_CREDITS, 0, 32767, credits);
4: credits[i++] = '\0';
5:
6: j = 0;
7: authors.push_back(0); /* find the start of each
credit-line */
8: for (i = 0; credits[i] != 0; i++)
9: if (credits[i] == 10)
10: authors.push_back(i+1);
11: authors.push_back(i);
The postfix ++ applied on lines 2 and 4 result in a modification to i that is
never read, but deadcode.DeadStores doesn't report this.
See attached source, lines 40-43 in intro.cpp</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>