[PATCH v1 33/35] Assume __has_attribute(__cold__)
Alejandro Colomar
alx@kernel.org
Sun Nov 9 21:54:11 GMT 2025
We already assume that GCC is at least GCC 5,
and we also assume that Clang is at least Clang 4.
Clang added support for __attribute__((__cold__)) in Clang 3.2:
llvm.git 29c2b4330ce0 (2012-05-12; "Add support for __attribute__((hot)) and __attribute__((cold)).")
$ git describe --contains 29c2b4330ce0
llvmorg-3.2.0-rc1~1^2~9639
Signed-off-by: Alejandro Colomar <alx@kernel.org>
---
misc/sys/cdefs.h | 4 ----
1 file changed, 4 deletions(-)
diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
index 2320f7293a..07eddbef74 100644
--- a/misc/sys/cdefs.h
+++ b/misc/sys/cdefs.h
@@ -93,11 +93,7 @@
# endif
# endif
-# if __GNUC_PREREQ (4, 3) || __glibc_has_attribute (__cold__)
# define __COLD __attribute__ ((__cold__))
-# else
-# define __COLD
-# endif
/* These two macros are not used in glibc anymore. They are kept here
only because some other projects expect the macros to be defined. */
--
2.51.0
More information about the Libc-alpha
mailing list