summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorRichard Weinberger <[email protected]>2024-08-09 11:54:29 +0200
committerTom Rini <[email protected]>2024-08-15 16:14:36 -0600
commita29805d822c4bffe47b464e1f62fca11c6c2b481 (patch)
treedaa248c68d1670143f87cdd0efe87a9b81e24745 /include/linux
parent35f75d2a46e5859138c83a75cd2f4141c5479ab9 (diff)
compiler: Ensure __builtin_*_overflow() support
Both gcc and clang support this for a long time. Make sure the feature is present. Signed-off-by: Richard Weinberger <[email protected]>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/compiler_types.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h
index 1a3060117f1..8b6ce9c11cd 100644
--- a/include/linux/compiler_types.h
+++ b/include/linux/compiler_types.h
@@ -71,6 +71,13 @@ extern void __chk_io_ptr(const volatile void __iomem *);
#endif
/*
+ * At least gcc 5.1 or clang 8 are needed.
+ */
+#ifndef COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW
+#error Unsupported compiler
+#endif
+
+/*
* Some architectures need to provide custom definitions of macros provided
* by linux/compiler-*.h, and can do so using asm/compiler.h. We include that
* conditionally rather than using an asm-generic wrapper in order to avoid