r188681 - [analyzer] Add "unmodified variable" checker to the Potential Checkers.
Jordan Rose
jordan_rose at apple.com
Mon Aug 19 09:27:38 PDT 2013
Author: jrose
Date: Mon Aug 19 11:27:37 2013
New Revision: 188681
URL: http://llvm.org/viewvc/llvm-project?rev=188681&view=rev
Log:
[analyzer] Add "unmodified variable" checker to the Potential Checkers.
This is PR16890.
Modified:
cfe/trunk/www/analyzer/potential_checkers.html
Modified: cfe/trunk/www/analyzer/potential_checkers.html
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/www/analyzer/potential_checkers.html?rev=188681&r1=188680&r2=188681&view=diff
==============================================================================
--- cfe/trunk/www/analyzer/potential_checkers.html (original)
+++ cfe/trunk/www/analyzer/potential_checkers.html Mon Aug 19 11:27:37 2013
@@ -288,6 +288,30 @@ void test() {
</table>
+<!-- ============================== dead code ============================== -->
+<h3>dead code</h3>
+<table class="checkers">
+<col class="namedescr"><col class="example"><col class="progress">
+<thead><tr><td>Name, Description</td><td>Example</td><td>Progress</td></tr></thead>
+
+<tr><td><span class="name">deadcode.UnmodifiedVariable
+<br>(C, C++)</span><br><br>
+A variable is never modified but was not declared const and is not a reference.
+</td><td><pre>
+extern int computeDelta();
+
+int foo(bool cond) {
+ int i = 0;
+ if (cond) {
+ const int delta = computeDelta();
+ // Forgot to modify 'i'.
+ }
+ return i;
+}
+</pre></td><td class="aligned"><a href="http://llvm.org/bugs/show_bug.cgi?id=16890">PR16890</a></td></tr>
+
+</table>
+
<!-- ========================= undefined behavior ========================== -->
<h3>undefined behavior</h3>
<table class="checkers">
More information about the cfe-commits
mailing list