The Xcode 4 static analyzer reports in my code some false positives. Is there any way to suppress them?
Add -fdiagnostics-show-option to your CFLAGS and you can see which flag you can use to disable that warning. Thanks ! Exactly what i needed !
The static analyzer is a tool in Xcode that can discover bugs by analyzing the source code without running it, so it can reveal bugs, even before you do testing and quality assurance of your app. It can also find problems in code paths that are rare and not covered by tests.
The Clang Static Analyzer is a source code analysis tool that finds bugs in C, C++, and Objective-C programs. It implements path-sensitive, inter-procedural analysis based on symbolic execution technique.
I found a solution: false positives (like the Apple singleton design pattern) can be avoided with:
#ifndef __clang_analyzer__ // Code not to be analyzed #endif
Analyzer will not analyze the code between those preprocessor directives.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With