[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen staging] xen/macros: Drop alternative definition of BUILD_BUG_ON(_ZERO)? for old GCC
commit b979189a67637a6a6553ddfb81bea9741bfe9b6a Author: Nicola Vetrini <nicola.vetrini@xxxxxxxxx> AuthorDate: Thu Aug 14 11:36:44 2025 +0200 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Thu Aug 14 11:36:44 2025 +0200 xen/macros: Drop alternative definition of BUILD_BUG_ON(_ZERO)? for old GCC The toolchain baseline for GCC is 5.1, which supports _Static_assert in c99 mode No functional change. Signed-off-by: Nicola Vetrini <nicola.vetrini@xxxxxxxxx> Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> --- xen/include/xen/macros.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/xen/include/xen/macros.h b/xen/include/xen/macros.h index cd528fbdb1..f9ccde86fb 100644 --- a/xen/include/xen/macros.h +++ b/xen/include/xen/macros.h @@ -40,9 +40,6 @@ #ifndef __ASSEMBLY__ -/* 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 ")"); }) @@ -54,11 +51,6 @@ */ #define BUILD_BUG_ON_ZERO(cond) \ (sizeof(struct { char c; _Static_assert(!(cond), "!(" #cond ")"); }) & 0) -#else -#define BUILD_BUG_ON_ZERO(cond) \ - (sizeof(struct { unsigned u : !(cond); }) & 0) -#define BUILD_BUG_ON(cond) ((void)BUILD_BUG_ON_ZERO(cond)) -#endif /* * Force a compilation error. This is for code which, in the normal case, -- generated by git-patchbot for /home/xen/git/xen.git#staging
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |