From 3767d76d7218e430c9267089e6ac4d574d3ffe96 Mon Sep 17 00:00:00 2001 From: Sam Deane Date: Tue, 18 Jun 2013 18:00:53 +0100 Subject: [PATCH] Disable ECAssertion macros when being analyzed with clang. --- Source/Generic/ECAssertion.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Generic/ECAssertion.h b/Source/Generic/ECAssertion.h index a4c8166..0f3d088 100644 --- a/Source/Generic/ECAssertion.h +++ b/Source/Generic/ECAssertion.h @@ -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)