Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 389
Sheehan Alam Avatar asked Feb 27 '23 01:02

Sheehan Alam


2 Answers

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.

like image 195
Nimrod Avatar answered Apr 08 '23 15:04

Nimrod


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.

like image 45
Brad Larson Avatar answered Apr 08 '23 17:04

Brad Larson