compiler.h: define STATIC_ASSERT() to no-op when checking with sparse
authorEric Biggers <ebiggers3@gmail.com>
Thu, 17 Nov 2016 05:32:11 +0000 (21:32 -0800)
committerEric Biggers <ebiggers3@gmail.com>
Thu, 17 Nov 2016 05:48:57 +0000 (21:48 -0800)
The expression used in STATIC_ASSERT() was not compatible with 'sparse'.

include/wimlib/compiler.h

index 2b1923c..6a87e89 100644 (file)
 #endif
 
 /* STATIC_ASSERT() - verify the truth of an expression at compilation time.  */
-#if __STDC_VERSION__ >= 201112L
+#ifdef __CHECKER__
+#  define STATIC_ASSERT(expr)
+#elif __STDC_VERSION__ >= 201112L
 #  define STATIC_ASSERT(expr)  _Static_assert((expr), "")
 #else
 #  define STATIC_ASSERT(expr)  ((void)sizeof(char[1 - 2 * !(expr)]))