简体   繁体   中英

XCode Static Analyzer: Analyzer skipped this file due to parse errors

I have been able to run the Static Analyzer on my code fine for months. All of a sudden now I am getting the error:

<command line>:0:0 Analyzer skipped this file due to parse errors

Not sure how to diagnose.

The first tile it skips is:

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContext.h:0:0 Analyzer skipped this file due to parse errors

如果我在目标设置为模拟器时尝试使用它,我也会收到这些错误,但是如果我将目标切换到设备那么它就可以工作了。

Typically, this is a result of a syntax error or something else that is preventing your code from compiling.

Because you are only seeing errors when you go to analyze your code, not when it compiles, I bet that you are using the GCC compiler for your main application builds. Clang / LLVM has a bug in the iOS 4.1 SDK that causes compilation errors when targeting the Simulator, but not the device. The Clang Static Analyzer is probably exhibiting this same bug.

The solution I provide in my answer to the above-linked question should work to fix this as well. However, it may lead to compilation errors when you switch back to build your application with GCC, so I recommend switching your compiler over to LLVM. Unless you are using C++ code, I recommend using LLVM for iPhone projects anyway, due to the minor performance boosts you can get in your compiled application with it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM