Xcode 3.2:构建&分析从未发现任何问题 [英] Xcode 3.2: Build & Analyze never finds any issues

查看:311
本文介绍了Xcode 3.2:构建&分析从未发现任何问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我之前使用过命令行中的Clang静态分析器。我想尝试Xcode的内置版本通过构建&分析。我从来没有得到任何负面的结果,即使我特别准备了我的代码与非常明显的问题Clang总是能够指出:

I've used the Clang Static Analyzer from the command line before. I wanted to try Xcode's built-in version via Build & Analyze. I never get any negative results even though i specially prepared my code with very obvious issues Clang was always able to 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];

结果总是相同的:绿色复选框,没有问题。
我读到C ++代码可能会导致问题。我使用包含box2d的cocos2d运行它。这可能是一个原因吗?有没有人从建设&使用cocos2d引擎分析?还可以是什么?

The result is always the same: a green checkbox, no issues. I read that C++ code can cause issues. I'm running this with cocos2d that includes box2d. Could this be a cause? Did anyone get results from Build & Analyze with the cocos2d engine? What else could it be?

我也试过启用静态分析器构建设置,然后Build,但结果是一样的。我已经重新启动Xcode,清除所有目标和清空Xcode缓存无效。

I also tried enabling the Static Analyzer Build Settings and then Build but the result was the same. I have restarted Xcode, cleaned all targets and emptied Xcode caches to no avail.

更新:我的问题可能是由添加了cocos2d作为我项目的交叉项目引用。分析cocos2d项目本身会单独显示一些分析器结果。

UPDATE: my issue could be caused by having added cocos2d as a cross-project reference to my project. Analyzing the cocos2d project itself seperately reveals some analyzer results.

此外,我发现我从我的RELEASE构建配置,但不是从DEBUG构建。 >

In addition i found out that i get Analyzer results from my RELEASE build configurations but not from DEBUG builds.

推荐答案

我使用Cocos2d和Box2d,我从Build和Analyze中得到了很多警告。检查以确保您的项目的编译器设置为GCC 4.2在编译版本在构建设置。

I'm using Cocos2d and Box2d, and I get plenty of warnings from Build and Analyze. Check to make sure your project's compiler is set to GCC 4.2 under "Compiler Version" in the Build Settings.

这篇关于Xcode 3.2:构建&分析从未发现任何问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆