views:

165

answers:

2

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

+2  A: 

I get these errors too if I try to use it when the target is set to the simulator, but if I switch the target to the device then it works.

Nimrod
Same errors here. Analyzing works when i build for device
Sander Backus
Odd, works for me also when I change to device.
Sheehan Alam
As I explain in my answer, this is most likely due to this bug in the iOS 4.1 SDK: http://stackoverflow.com/questions/3677879/strange-issue-after-upgrading-to-ios-4-1-sdk
Brad Larson
+2  A: 

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.

Brad Larson