[PATCH v1 05/35] Assume GCC 4.2 or later
Alejandro Colomar
alx@kernel.org
Sun Nov 9 21:52:57 GMT 2025
This is what Clang claims to support.
$ clang --version;
Debian clang version 19.1.7 (3+b1)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm-19/bin
$ echo __GNUC__ __GNUC_MINOR__ \
| clang -E -x c /dev/stdin \
| tail -n1;
4 2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
---
include/features.h | 2 --
misc/sys/cdefs.h | 4 ----
2 files changed, 6 deletions(-)
diff --git a/include/features.h b/include/features.h
index 7d8095c682..c067077139 100644
--- a/include/features.h
+++ b/include/features.h
@@ -433,8 +433,6 @@
#if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0
# if !defined __OPTIMIZE__ || __OPTIMIZE__ <= 0
# warning _FORTIFY_SOURCE requires compiling with optimization (-O)
-# elif !__GNUC_PREREQ (4, 1)
-# warning _FORTIFY_SOURCE requires GCC 4.1 or later
# elif _FORTIFY_SOURCE > 2 && (__glibc_clang_prereq (9, 0) \
|| __GNUC_PREREQ (12, 0))
diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
index 53e4355862..6a680adcde 100644
--- a/misc/sys/cdefs.h
+++ b/misc/sys/cdefs.h
@@ -716,11 +716,7 @@ _Static_assert (0, "IEEE 128-bits long double requires redirection on this platf
/* Specify that a function such as setjmp or vfork may return
twice. */
-#if __GNUC_PREREQ (4, 1)
# define __attribute_returns_twice__ __attribute__ ((__returns_twice__))
-#else
-# define __attribute_returns_twice__ /* Ignore. */
-#endif
/* Mark struct types as aliasable. Restricted to compilers that
support forward declarations of structs in the presence of the
--
2.51.0
More information about the Libc-alpha
mailing list