From: Roger Pau Monné Date: Tue, 2 Jun 2020 11:39:02 +0000 (+0200) Subject: compilers: always use _Static_assert with clang X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~119 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3d5a836379e5064d563322de095d0775607ff185;p=xen.git compilers: always use _Static_assert with clang All versions of clang used by Xen support _Static_assert, so use it unconditionally when building Xen with clang. No functional change expected. Signed-off-by: Roger Pau Monné Reviewed-by: Wei Liu Acked-by: Andrew Cooper Release-acked-by: Paul Durrant --- diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h index e5b0a007b8..076bcfb67d 100644 --- a/xen/include/xen/lib.h +++ b/xen/include/xen/lib.h @@ -25,7 +25,9 @@ #define BUG_ON(p) do { if (unlikely(p)) BUG(); } while (0) #define WARN_ON(p) do { if (unlikely(p)) WARN(); } while (0) -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +/* All clang versions supported by Xen have _Static_assert. */ +#if defined(__clang__) || \ + (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) /* Force a compilation error if condition is true */ #define BUILD_BUG_ON(cond) ({ _Static_assert(!(cond), "!(" #cond ")"); })