Is it possible to suppress Xcode 4 static analyzer warnings?

DreamOfMirrors picture DreamOfMirrors · Apr 27, 2011 · Viewed 9.8k times · Source

The Xcode 4 static analyzer reports in my code some false positives. Is there any way to suppress them?

Answer

DreamOfMirrors picture DreamOfMirrors · Apr 29, 2011

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.