views:

74

answers:

4

This is similar to another question that wasn't really answered: http://stackoverflow.com/questions/2738363/xcode-3-2-build-analyze-never-finds-any-issues

I used XCode's Build and Analyze for the first time on a large project and came up with a number of analyzer warnings. I corrected a few and wanted to verify my changes were being 'accepted' by the analyzer. I didn't even look at warnings in a number of files. But when I re-run Build and Analyze, all the warnings are gone.

I have tried: changing my compiler to LVVC GCC 4.2, switching from a debug to a release build, cleaning all (repeatedly), and quitting and reopening XCode. I just can't get the old warnings back.

A: 

Build and analyze only analyzes your modified files.

Go to your project settings -> build tab. And check 'Run Static Analyzer'. This runs a full check on all files on each build.

Sander Backus
+1  A: 

It is how XCode built with. Whenever, you build the project (even using build & analyze), it will build only those files which are modified before the last build. So if you want to have your old warning & analysis result back, do clean all targets from build menu & again build.

Sagar
A: 

I had a similar issue some days ago. I had plenty of warnings, and after some changes in the code the analyzer warnings disappeared. Even a clean build could not bring them back.

By a coincidence I changed the message filter in the build log from Issues Only to All messages.
And there were plenty of messages related to the disappear of analyzer results. The analyzer complained that he could not analyze my files. I'm sorry I don't remember the correct message.

As far as I remember I put some code into the .pch which confused the analyzer completely. After I changed a lot of stuff analyzer was happy again. Magically. I still don't know why that happened and I can't reproduce it.

fluchtpunkt
A: 

For whatever reason, none of the solutions above worked for me. The only way I could get the warnings back was to open the project with XCode 4 and analyze it there. I am taking screenshots so I don't lose these warnings. I hope the analyzer works better in XCode 4 in the future.

ed94133