Xcode 3.2: Build & Analyze never detects any problems
I've used the Clang static analyzer from the command line before. I wanted to try the built-in version of Xcode via Build and Analyze. I never get any negative results, although I specially prepared my code with very obvious problems that Klang could always point out:
// over-releasing an object:
[label release];
[label release];
// uninitialized vars, allocating but not freeing an object
NSString* str;
int number;
CCLabel* newLabel = [[CCLabel alloc] initWithString:str fontName:str fontSize:number];
[newLabel setPosition:CGPointZero];
The result is always the same: green flag, no problem. I read that C ++ code can cause problems. I am running this with cocos2d which includes box2d. Could this be the reason? Has anyone gotten results from build and analysis with cocos2d engine? What else could it be?
I also tried to enable static analyzer build settings and then build, but the result was the same. I restarted Xcode, cleared all targets, and freed Xcode caches to no avail.
UPDATE: my problem could be caused by adding cocos2d as a cross-project reference to my project. The analysis of the cocos2d project itself shows some of the analyzer results.
Also, I found out that I am getting parser results from my RELEASE build configurations, but not from the DEBUG compilations.
a source to share
For those who may run into this thread (and for the OP in case the issue persists):
I had this problem while building for the Simulator. However, the move to device assembly made Analyzer work.
This site may shed some light on the problem: http://useyourloaf.com/blog/2010/10/5/xcode-build-and-analyze-broken-for-simulator.html
a source to share