r188681 - [analyzer] Add "unmodified variable" checker to the Potential Checkers.

Anna Zaks ganna at apple.com
Mon Aug 19 09:57:59 PDT 2013


Should we mention that this would be an opt-in checker? 

Anna.
On Aug 19, 2013, at 9:27 AM, Jordan Rose <jordan_rose at apple.com> wrote:

> 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">
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list