[cfe-commits] r158581 - in /cfe/trunk: docs/UsersManual.html www/analyzer/faq.html

Anna Zaks ganna at apple.com
Fri Jun 15 17:30:21 PDT 2012


Author: zaks
Date: Fri Jun 15 19:30:21 2012
New Revision: 158581

URL: http://llvm.org/viewvc/llvm-project?rev=158581&view=rev
Log:
Make the analyzer site a single point of reference for info
on controlling diagnostics.

Modified:
    cfe/trunk/docs/UsersManual.html
    cfe/trunk/www/analyzer/faq.html

Modified: cfe/trunk/docs/UsersManual.html
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/UsersManual.html?rev=158581&r1=158580&r2=158581&view=diff
==============================================================================
--- cfe/trunk/docs/UsersManual.html (original)
+++ cfe/trunk/docs/UsersManual.html Fri Jun 15 19:30:21 2012
@@ -708,36 +708,11 @@
 
 <p>While not strictly part of the compiler, the diagnostics from Clang's <a
 href="http://clang-analyzer.llvm.org">static analyzer</a> can also be influenced
-by the user via changes to the source code.  This can be done in two ways:
-
-<ul>
-
-<li id="analyzer_annotations"><b>Annotations</b>: The static analyzer recognizes various GCC-style
-attributes (e.g., <tt>__attribute__((nonnull)))</tt>) that can either suppress
-static analyzer warnings or teach the analyzer about code invariants which
-enable it to find more bugs. While many of these attributes are standard GCC
-attributes, additional ones have been added to Clang to specifically support the
-static analyzer. Detailed information on these annotations can be found in the
-<a href="http://clang-analyzer.llvm.org/annotations.html">analyzer's
-documentation</a>.</li>
-
-<li><b><tt>__clang_analyzer__</tt></b>: When the static analyzer is using Clang
-to parse source files, it implicitly defines the preprocessor macro
-<tt>__clang_analyzer__</tt>. While discouraged, code can use this macro to
-selectively exclude code the analyzer examines.  Here is an example:
-
-<pre>
-#ifndef __clang_analyzer__
-// Code not to be analyzed
-#endif
-</pre>
-
-In general, this usage is discouraged. Instead, we prefer that users file bugs
-against the analyzer when it flags false positives. There is also active
-discussion of allowing users in the future to selectively silence specific
-analyzer warnings (some of which can already be done using <a
-href="#analyzer_annotations">annotations</a>).</li>
-
+by the user via changes to the source code. See the avaliable 
+<a href = "http://clang-analyzer.llvm.org/annotations.html" >annotations</a> and 
+the analyzer's 
+<a href= "http://clang-analyzer.llvm.org/faq.html#exclude_code" >FAQ page</a> for 
+more information.
 </ul>
 
 <!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -->

Modified: cfe/trunk/www/analyzer/faq.html
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/www/analyzer/faq.html?rev=158581&r1=158580&r2=158581&view=diff
==============================================================================
--- cfe/trunk/www/analyzer/faq.html (original)
+++ cfe/trunk/www/analyzer/faq.html Fri Jun 15 19:30:21 2012
@@ -28,6 +28,7 @@
 null?</a></li>
   <li><a href="#use_assert">The analyzer assumes that a loop body is never entered.  How can I tell it that the loop body will be entered at least once?</a></li>
   <li><a href="#suppress_issue">How can I suppress a specific analyzer warning?</a></li>
+  <li><a href="#exclude_code">How can I selectively exclude code the analyzer examines?</a></li>
 </ol>
 
 
@@ -87,9 +88,30 @@
 
 <h4 id="suppress_issue" class="faq">Q: How can I suppress a specific analyzer warning?</h4>
 
-<p>There is currently no mechanism for suppressing the analyzer warning,
-although this is currently being investigated. If you encounter an analyzer
-bug/false positive, please <a href = "filing_bugs.html">report it</a>.</p>
+<p>There is currently no solid mechanism for suppressing an analyzer warning,
+although this is currently being investigated. When you encounter an analyzer
+bug/false positive, check if it's one of the issues discussed above or if the
+analyzer <a href = "annotations.html#custom_assertions" >annotations</a> can 
+resolve the issue. Second, please <a href = "filing_bugs.html">report it</a> to 
+help us improve user experience. As the last resort, consider using <tt>__clang_analyzer__</tt> macro
+<a href = "faq.html#exclude_code" >described below</a>.</p>
+
+<h4 id="exclude_code" class="faq">Q: How can I selectively exclude code the analyzer examines?</h4>
+
+<p>When the static analyzer is using clang to parse source files, it implicitly 
+defines the preprocessor macro <tt>__clang_analyzer__</tt>. One can use this 
+macro to selectively exclude code the analyzer examines. Here is an example:
+
+<pre class="code_example">
+#ifndef __clang_analyzer__
+// Code not to be analyzed
+#endif
+</pre>
+
+This usage is discouraged because it makes the code dead to the analyzer from 
+now on. Instead, we prefer that users file bugs against the analyzer when it flags 
+false positives.
+</p>
 
 </div>
 </div>





More information about the cfe-commits mailing list