Skip to content

Commit

Permalink
Disable ECAssertion macros when being analyzed with clang.
Browse files Browse the repository at this point in the history
  • Loading branch information
samdeane committed Jun 18, 2013
1 parent e6794b5 commit 3767d76
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/Generic/ECAssertion.h
Expand Up @@ -17,6 +17,10 @@

ECDeclareDebugChannel(AssertionChannel);

#endif

#if EC_DEBUG && !defined(__clang_analyzer__) // don't evaluate assertions whilst we're being analyzed as it can confuse clang into thinking that some code paths are normal when actually they aren't

#define ECAssert(expression) do { if (!(expression)) { ECDebug(AssertionChannel, @"Expression %s was false", #expression); [ECAssertion failAssertion:#expression]; } } while(0)
#define ECAssertC(expression) assert(expression)

Expand Down

0 comments on commit 3767d76

Please sign in to comment.