[cfe-commits] r96658 - in /cfe/trunk/www/analyzer: images/scan_build_cmd.png scan-build.html

Ted Kremenek kremenek at apple.com
Thu Feb 18 21:36:48 PST 2010

Author: kremenek
Date: Thu Feb 18 23:36:44 2010
New Revision: 96658

URL: http://llvm.org/viewvc/llvm-project?rev=96658&view=rev
Add new intro about running scan-build.


Added: cfe/trunk/www/analyzer/images/scan_build_cmd.png
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/www/analyzer/images/scan_build_cmd.png?rev=96658&view=auto

Binary files cfe/trunk/www/analyzer/images/scan_build_cmd.png (added) and cfe/trunk/www/analyzer/images/scan_build_cmd.png Thu Feb 18 23:36:44 2010 differ

Modified: cfe/trunk/www/analyzer/scan-build.html
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/www/analyzer/scan-build.html?rev=96658&r1=96657&r2=96658&view=diff

--- cfe/trunk/www/analyzer/scan-build.html (original)
+++ cfe/trunk/www/analyzer/scan-build.html Thu Feb 18 23:36:44 2010
@@ -2,7 +2,7 @@
-  <title>Running the Analyzer</title>
+  <title>scan-build: running the analyzer from the command line</title>
   <link type="text/css" rel="stylesheet" href="content.css" />
   <link type="text/css" rel="stylesheet" href="menu.css" />
   <script type="text/javascript" src="scripts/menu.js"></script>  
@@ -30,17 +30,48 @@
 table.options td { text-align:left; font-size:9pt }
-<h1>Running the Analyzer</h1>
+<h1>scan-build: running the analyzer from the command line</h1>
-<p>While the static analyzer engine can be used as a library, many users will
-likely use the command-line interface to the analyzer to analyze projects. This
-page documents <tt>scan-build</tt>, a program that users can use from the
-command line to analyze all the source files used to build a project.</p>
+<table style="margin-top:0px" width="100%" border="0" cellpadding="0px" cellspacing="0">
+<h3>What is it?</h3>
+<p><b>scan-build</b> is a command line utility that enables a user to run the
+static analyzer over their codebase as part of performing a regular build (from
+the command line).</p>
+<h3>How does it work?</h3>
+<p>During a project build, as source files are compiled they are also analyzed
+in tandem by the static analyzer.</p>
+<p>Upon completion of the build, results are then presented to the user within a
+web browser.</p>
+<h3>Will it work with any build system?</h3>
+<p><b>scan-build</b> has little or no knowledge about how you build your code.
+It works by overriding the <tt>CC</tt> and <tt>CXX</tt> environment variables to
+(hopefully) change your build to use a "fake" compiler instead of the
+one that would normally build your project. By default, this fake compiler
+executes <tt>gcc</tt> to compile your code (assuming that <tt>gcc</tt> is your
+compiler) and then executes the static analyzer to analyze your code.</p>
+<p>This "poor man's interposition" works amazingly well in many cases
+and falls down in others. Please consult the information on this page on making
+the best use of <b>scan-build</b>, which includes getting it to work when the
+aforementioned hack fails to work.</p>
+<td style="padding-left:10px">
+  <img src="images/scan_build_cmd.png" width="450px" border=0><br>
+  <a href="images/analyzer_html.png"><img src="images/analyzer_html.png" width="450px" border=0></a>
+<br><b>Viewing static analyzer results in a web browser</b></center>
-<li><a href="#scanbuild">scan-build</a></li>
+<li><a href="#scanbuild">Getting Started</a></li>
   <li><a href="#scanbuild_basicusage">Basic Usage</a></li>
   <li><a href="#scanbuild_otheroptions">Other Options</a></li>
@@ -54,7 +85,7 @@
-<h2 id="scanbuild">scan-build</h2>
+<h2 id="scanbuild">Getting Started</h2>
 <p>The <tt>scan-build</tt> command can be used to analyze an entire project by
 essentially interposing on a project's build process. This means that to run the
@@ -165,14 +196,14 @@
 <p>This section describes a few recommendations with running the analyzer.</p>
-<h3 id="recommended_debug">Always Analyze a Project in its "Debug" Configuration</h3>
+<h3 id="recommended_debug">ALWAYS analyze a project in its "debug" configuration</h3>
 <p>Most projects can be built in a "debug" mode that enables assertions.
 Assertions are picked up by the static analyzer to prune infeasible paths, which
 in some cases can greatly reduce the number of false positives (bogus error
 reports) emitted by the tool.</p>
-<h3 id="recommend_verbose">Use Verbose Output when Debugging scan-build</h3>
+<h3 id="recommend_verbose">Use verbose output when debugging scan-build</h3>
 <p><tt>scan-build</tt> takes a <b>-v</b> option to emit verbose output about
 what it's doing; two <b>-v</b> options emit more information. Redirecting the

More information about the cfe-commits mailing list