[PATCH v1 23/35] Assume _Static_assert(3) is supported by the compiler

Alejandro Colomar alx@kernel.org
Sun Nov 9 21:53:45 GMT 2025


We already assume that GCC is at least GCC 5,
and we also assume that Clang is at least Clang 4.

I don't know when Clang added support for _Static_assert(3),
but I see it being supported in Clang 3.3:

llvm.git c804e08a674a (2013-04-03; "Enable use of _Static_assert inside structs and unions in C11 mode (as per C11 6.7.2.1p1).")

	$ git describe --contains c804e08a674a
	llvmorg-3.3.0-rc1~7^2~2197

Signed-off-by: Alejandro Colomar <alx@kernel.org>
---
 soft-fp/soft-fp.h | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/soft-fp/soft-fp.h b/soft-fp/soft-fp.h
index 086fb34a28..e13eb8e0c4 100644
--- a/soft-fp/soft-fp.h
+++ b/soft-fp/soft-fp.h
@@ -47,15 +47,8 @@
 # endif
 #endif
 
-#if ((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))	\
-     || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L))
 # define _FP_STATIC_ASSERT(expr, msg)		\
   _Static_assert ((expr), msg)
-#else
-# define _FP_STATIC_ASSERT(expr, msg)					\
-  extern int (*__Static_assert_function (void))				\
-    [!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })]
-#endif
 
 /* In the Linux kernel, some architectures have a single function that
    uses different kinds of unpacking and packing depending on the
-- 
2.51.0



More information about the Libc-alpha mailing list