Since sparse doesn't support _Pragma(message()), but uses the same defines as
GCC, the BUILD_MESSAGE macro will cause sparse errors.

This commit simply disables BUILD_MESSAGE if __CHECKER__ is defined

Reported-by: Ben Pfaff <b...@nicira.com>
Signed-off-by: Daniele Di Proietto <ddiproie...@vmware.com>
---
 lib/compiler.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/compiler.h b/lib/compiler.h
index 629d09b..1cd152d 100644
--- a/lib/compiler.h
+++ b/lib/compiler.h
@@ -231,7 +231,7 @@
 
 /* Output a message (not an error) while compiling without failing the
  * compilation process */
-#if HAVE_PRAGMA_MESSAGE
+#if HAVE_PRAGMA_MESSAGE && !__CHECKER__
 #define DO_PRAGMA(x) _Pragma(#x)
 #define BUILD_MESSAGE(x) \
     DO_PRAGMA(message(x))
-- 
2.1.0.rc1

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to