[CRIU] [PATCH 03/13] clang: add an exception for BUG_ON_HANDLER

Andrey Vagin avagin at openvz.org
Wed Apr 3 13:31:02 EDT 2013


Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 include/bug.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/bug.h b/include/bug.h
index 4475a09..920abda 100644
--- a/include/bug.h
+++ b/include/bug.h
@@ -13,6 +13,7 @@
 # define __raise() raise(SIGABRT)
 #endif
 
+#ifndef __clang_analyzer__
 # define BUG_ON_HANDLER(condition)							\
 	do {										\
 		if ((condition)) {							\
@@ -21,6 +22,12 @@
 			*(volatile unsigned long *)NULL = 0xdead0000 + __LINE__;	\
 		}									\
 	} while (0)
+#else
+# define BUG_ON_HANDLER(condition)	\
+	do {				\
+		assert(!condition);	\
+	} while (0)
+#endif
 
 #endif /* BUG_ON_HANDLER */
 
-- 
1.7.11.7



More information about the CRIU mailing list