From a56bff8e3a55a1379e0b782b206b6f394e672189 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Wed, 16 Nov 2016 21:32:11 -0800 Subject: [PATCH] compiler.h: define STATIC_ASSERT() to no-op when checking with sparse The expression used in STATIC_ASSERT() was not compatible with 'sparse'. --- include/wimlib/compiler.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/wimlib/compiler.h b/include/wimlib/compiler.h index 2b1923c2..6a87e891 100644 --- a/include/wimlib/compiler.h +++ b/include/wimlib/compiler.h @@ -185,7 +185,9 @@ #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)])) -- 2.43.0