Setting Up Clang Static Analyzer and Xcode (in three steps)
Shaun, Dec 2Xcode's Build & Analyze is great, but as far as I've encountered, it doesn't find everything that Clang Static Analyzer does, even if it is based on it.
Here's a quick guide to install Clang:
- Download the latest "checker-XX.tar.bz2" from http://clang-analyzer.llvm.org/
- Extract, and move the contents to "/Developer/Tools/clang/"
- Add this line to your ~/.bash_profile file.
alias clang_gen='rm -rf /tmp/scan-build*; xcodebuild clean; /Developer/Tools/clang/scan-build --view xcodebuild'
That's pretty much it! Just go to your project directory in Terminal now, and run "clang_gen". Once it's done running, it should open up Safari with the results.