<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>It's there on the analyzer site, under "<a href="http://clang-analyzer.llvm.org/scan-build.html">Command Line Usage</a>":</div><div><br></div><div><p style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; font-size: small; line-height: 19px; text-align: left; background-color: rgb(255, 255, 255); position: static; z-index: auto; "><blockquote type="cite"><b>scan-build</b> has little or no knowledge about how you build your code. It works by overriding the <tt style="color: rgb(0, 0, 0);">CC</tt> and <tt style="color: rgb(0, 0, 0);">CXX</tt> environment variables to (hopefully) change your build to use a "fake" compiler instead of the one that would normally build your project. This fake compiler executes either <tt style="color: rgb(0, 0, 0);">clang</tt> or <tt style="color: rgb(0, 0, 0);">gcc</tt> (depending on the platform) to compile your code and then executes the static analyzer to analyze your code.</blockquote></p></div><div><br></div><div><blockquote type="cite"></blockquote></div><div><blockquote type="cite"><span style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; font-size: small; line-height: 19px; text-align: left; ">The reason</span><span style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; font-size: small; line-height: 19px; text-align: left; "> </span><tt style="font-size: small; line-height: 19px; text-align: left; ">configure</tt><span style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; font-size: small; line-height: 19px; text-align: left; "> </span><span style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; font-size: small; line-height: 19px; text-align: left; ">also needs to be run through</span><span style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; font-size: small; line-height: 19px; text-align: left; "> </span><tt style="font-size: small; line-height: 19px; text-align: left; ">scan-build</tt><span style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; font-size: small; line-height: 19px; text-align: left; "> </span><span style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; font-size: small; line-height: 19px; text-align: left; ">is because</span><span style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; font-size: small; line-height: 19px; text-align: left; "> </span><tt style="font-size: small; line-height: 19px; text-align: left; ">scan-build</tt><span style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; font-size: small; line-height: 19px; text-align: left; "> </span><span style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; font-size: small; line-height: 19px; text-align: left; ">scans your source files by</span><span style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; font-size: small; line-height: 19px; text-align: left; "> </span><i style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; font-size: small; line-height: 19px; text-align: left; ">interposing</i><span style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; font-size: small; line-height: 19px; text-align: left; "> </span><span style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; font-size: small; line-height: 19px; text-align: left; ">on the compiler. This interposition is currently done by</span><span style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; font-size: small; line-height: 19px; text-align: left; "> </span><tt style="font-size: small; line-height: 19px; text-align: left; ">scan-build</tt><span style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; font-size: small; line-height: 19px; text-align: left; "> </span><span style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; font-size: small; line-height: 19px; text-align: left; ">temporarily se</span><span style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; font-size: small; line-height: 19px; text-align: left; ">tting the environment variable</span><span style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; font-size: small; line-height: 19px; text-align: left; "> </span><tt style="font-size: small; line-height: 19px; text-align: left; ">CC</tt><span style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; font-size: small; line-height: 19px; text-align: left; "> </span><span style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; font-size: small; line-height: 19px; text-align: left; ">to</span><span style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; font-size: small; line-height: 19px; text-align: left; "> </span><tt style="font-size: small; line-height: 19px; text-align: left; ">ccc-analyzer</tt><span style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; font-size: small; line-height: 19px; text-align: left; ">. The program</span><tt style="font-size: small; line-height: 19px; text-align: left; ">ccc-analyzer</tt><span style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; font-size: small; line-height: 19px; text-align: left; "> </span><span style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; font-size: small; line-height: 19px; text-align: left; ">acts like a fake compiler, forwarding its command line arguments over to the compiler to perform regular compilation and</span><tt style="font-size: small; line-height: 19px; text-align: left; ">clang</tt><span style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; font-size: small; line-height: 19px; text-align: left; "> </span><span style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; font-size: small; line-height: 19px; text-align: left; ">to perform static analysis.</span></blockquote></div><div><br></div><div>I guess we should throw a link to that page into the downloadable "checker" package, and possibly into scan-build itself.</div><div><br></div><div>Jordan</div><div><br></div><br><div><div>On Dec 12, 2012, at 11:16 , Peeter Joot <<a href="mailto:peeter.joot@gmail.com">peeter.joot@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Thanks, that's the key.  Could this be added to the scan-build docs?<div class="gmail_extra"><br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
IIRC, scan-build works by setting CC, CXX etc. environment variables.<br>
Since your Makefile does not use these, static analyzer is not being<br>
run.<br>
<span class="HOEnZb"><font color="#888888"><br></font></span></blockquote></div><div><br></div>-- <br>Peeter<br>
</div>
_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev<br></blockquote></div><br></body></html>