[cfe-dev] unclear about how to correctly run scan-build through make

Jordan Rose jordan_rose at apple.com
Wed Dec 12 11:22:28 PST 2012


It's there on the analyzer site, under "Command Line Usage":

> scan-build has little or no knowledge about how you build your code. It works by overriding the CC and CXX 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 clang or gcc (depending on the platform) to compile your code and then executes the static analyzer to analyze your code.
> 



> The reason configure also needs to be run through scan-build is because scan-build scans your source files by interposing on the compiler. This interposition is currently done by scan-build temporarily setting the environment variable CC to ccc-analyzer. The programccc-analyzer acts like a fake compiler, forwarding its command line arguments over to the compiler to perform regular compilation andclang to perform static analysis.


I guess we should throw a link to that page into the downloadable "checker" package, and possibly into scan-build itself.

Jordan


On Dec 12, 2012, at 11:16 , Peeter Joot <peeter.joot at gmail.com> wrote:

> Thanks, that's the key.  Could this be added to the scan-build docs?
> 
> 
> IIRC, scan-build works by setting CC, CXX etc. environment variables.
> Since your Makefile does not use these, static analyzer is not being
> run.
> 
> 
> -- 
> Peeter
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121212/43b6bafb/attachment.html>


More information about the cfe-dev mailing list