Search code examples
iosstatic-analysisclang-static-analyzer

How to get the scan-build static analyser to understand iOS ARC'd code


Hi I have installed the command line utility scan-build from http://clang-analyzer.llvm.org/scan-build.html.

When I run this on my Xcode 4.2 project which uses ARC, I get loads of potential memory leak warnings as the analyser is mistakenly thinking I have forgotten to manually release memory.

Does the latest version (checker-258) support ARC properly? The release notes say it should (http://clang-analyzer.llvm.org/release_notes.html) but this isn't the evidence I am seeing.

Thanks for any help..


Solution

  • I raised a bug with Apple about this - http://llvm.org/bugs/show_bug.cgi?id=11845. It turns out this was a known issue - see http://llvm.org/bugs/show_bug.cgi?id=11348.

    The fix is to install checker-260, see http://clang-analyzer.llvm.org/release_notes.html plus this modification to ccc-analyzer - http://llvm.org/viewvc/llvm-project?view=rev&revision=149094.

    Hopefully the fix to ccc-analyzer will be incorporated into a future release of scan-build.