Lines Matching full:scan
5 <title>scan-build: running the analyzer from the command line</title>
17 <h1>scan-build: running the analyzer from the command line</h1>
23 <p><b>scan-build</b> is a command line utility that enables a user to run the
35 <p><b>scan-build</b> has little or no knowledge about how you build your code.
44 the best use of <b>scan-build</b>, which includes getting it to work when the
49 <img src="images/scan_build_cmd.png" width="450px" alt="scan-build"><br>
61 <li><a href="#scanbuild_output">Output of scan-build</a></li>
67 <li><a href="#recommended_verbose">Use Verbose Output when Debugging scan-build</a></li>
68 <li><a href="#recommended_autoconf">Run './configure' through scan-build</a></li>
76 <p>The <tt>scan-build</tt> command can be used to analyze an entire project by
78 analyzer using <tt>scan-build</tt>, you will use <tt>scan-build</tt> to analyze
84 <p>Basic usage of <tt>scan-build</tt> is designed to be simple: just place the
85 word "scan-build" in front of your build command:</p>
88 $ <span class="code_highlight">scan-build</span> make
89 $ <span class="code_highlight">scan-build</span> xcodebuild
92 <p>In the first case <tt>scan-build</tt> analyzes the code of a project built
93 with <tt>make</tt> and in the second case <tt>scan-build</tt> analyzes a project
96 <p>Here is the general format for invoking <tt>scan-build</tt>:</p>
99 $ <span class="code_highlight">scan-build</span> <i>[scan-build options]</i> <span class="code_highlight"><command></span> <i>[command options]</i>
102 <p>Operationally, <tt>scan-build</tt> literally runs <command> with all of the
107 $ scan-build make <span class="code_highlight">-j4</span>
110 <p>In almost all cases, <tt>scan-build</tt> makes no effort to interpret the
112 <tt>scan-build</tt> should support parallel builds, but <b>not distributed
115 <p>It is also possible to use <tt>scan-build</tt> to analyze specific
119 $ scan-build gcc -c <span class="code_highlight">t1.c t2.c</span>
127 <p>As mentioned above, extra options can be passed to <tt>scan-build</tt>. These
131 $ scan-build <span class="code_highlight">-k -V</span> make
132 $ scan-build <span class="code_highlight">-k -V</span> xcodebuild
146 <tt>scan-build</tt> options.</td></tr>
153 <tr><td><b>-v</b></td><td>Verbose output from scan-build and the analyzer. <b>A
160 <p>A complete list of options can be obtained by running <tt>scan-build</tt>
163 <h3 id="scanbuild_output">Output of scan-build</h3>
166 The output of scan-build is a set of HTML files, each one which represents a
174 <tt>scan-build</tt>. If <b>-o</b> isn't specified, a directory in <tt>/tmp</tt>
175 is created to store the files (<tt>scan-build</tt> will print a message telling
177 completes, pass <b>-V</b> to <tt>scan-build</tt>.
192 <h3 id="recommend_verbose">Use verbose output when debugging scan-build</h3>
194 <p><tt>scan-build</tt> takes a <b>-v</b> option to emit verbose output about
196 output of <tt>scan-build</tt> to a text file (make sure to redirect standard
197 error) is useful for filing bug reports against <tt>scan-build</tt> or the
201 <h3 id="recommended_autoconf">Run './configure' through scan-build</h3>
205 <tt>scan-build</tt> in order to analyze the project.</p>
210 $ scan-build ./configure
211 $ scan-build make
215 <tt>scan-build</tt> is because <tt>scan-build</tt> scans your source files by
217 <tt>scan-build</tt> temporarily setting the environment variable <tt>CC</tt> to
224 <tt>scan-build</tt> that path is set to <tt>ccc-analyzer</tt>.</p>
234 <p>To analyze a project, <tt>scan-build</tt> simply sets the environment variable
247 <tt>scan-build</tt> so that configure sets up the location of <tt>CC</tt> based
248 on the environment passed in from <tt>scan-build</tt>:
251 $ scan-build <b>./configure</b>
254 <p><tt>scan-build</tt> has special knowledge about <tt>configure</tt>, so it in
268 their cousins for desktop applications. <b>scan-build</b> can analyze these
285 <h3>Using scan-build directly</h3>
287 <p>If you wish to use <b>scan-build</b> with your iPhone project, keep the
302 <b>scan-build</b> in the following manner from the command line:</p>
305 $ scan-build xcodebuild -configuration Debug -sdk iphonesimulator2.2
311 $ scan-build xcodebuild -configuration Debug -sdk iphonesimulator3.0
316 <p>Recall that <b>scan-build</b> analyzes your project by using a compiler to
320 iPhone projects, <b>scan-build</b> may pick the wrong compiler than the one
325 <p>When compiling your application to run on the simulator, it is important that <b>scan-build</b>
327 errors that only happen when you run <tt>scan-build</tt>.
329 <p><b>scan-build</b> provides the <tt>--use-cc</tt> and <tt>--use-c++</tt>
330 options to hardwire which compiler scan-build should use for building your code.
336 just running <tt>xcodebuild</tt> (without <b>scan-build</b>). You should see the