]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commitdiff
xen/lib.h: fix ASSERT() to build with clang
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 10 Feb 2016 13:48:36 +0000 (14:48 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 10 Feb 2016 13:48:36 +0000 (14:48 +0100)
Clang warns about a semicolon immediately following an if() clause as a
possible mistake, and recommends putting the semicolon on a new line if it was
intentional.  A newline is not an option here, so use a set of empty braces
instead.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/include/xen/lib.h

index 4258912ed9f4649b758989b782b117a081f9655a..1c652bb8c63f8322f01c76c4e507139d281fc147 100644 (file)
@@ -32,7 +32,7 @@
 #define ASSERT_UNREACHABLE() assert_failed("unreachable")
 #define debug_build() 1
 #else
-#define ASSERT(p) do { if ( 0 && (p) ); } while (0)
+#define ASSERT(p) do { if ( 0 && (p) ) {} } while (0)
 #define ASSERT_UNREACHABLE() do { } while (0)
 #define debug_build() 0
 #endif