The Clang Static Analyzer consists of both a source code analysis framework and a standalone tool that finds bugs in C and Objective-C programs. The standalone tool is invoked from the command-line, and is intended to run in tandem with a build of a project or code base.
Both are 100% open source and are part of the Clang project.
Download :http://clang-analyzer.llvm.org/
Mac OS X
* Latest build (Universal binary, 10.5+): checker-227.tar.bz2 (built November 4, 2009)
* Installation and usage
Installation
Since scan-build is a command line tool it makes sense to install it into one of OS X’s pre-defined command line tool locations. We’ll put it in /usr/local/bin.
- Make sure that you’ve expanded checker-NN.tar.gz to your Downloads folder
- We’re going to be installing the checker binaries into your /usr/local/bin directory. Run the following command to ensure that this directory exists:
- Open Terminal.app and move the contents of checker-NN to the /usr/local/bin directory (remember to replace NN with the build number of your download):
sudo mv ~/Downloads/checker-NN/* /usr/local/bin/
sudo mkdir -p /usr/local/bin
The analyzer must be run after a
xcodebuild clean command.
xcodebuild clean
scan-build -k -V xcodebuild
No comments:
Post a Comment