summaryrefslogtreecommitdiff
path: root/include/linux/compiler_types.h
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2020-10-19 09:35:39 +0200
committerArnd Bergmann <arnd@arndb.de>2020-10-28 14:55:36 +0100
commitcaabdd0f59a9771ed095efe3ad5a08867b976ab2 (patch)
tree3e588a89ccaddec4fce4a183b3e9ccaa7c60fc51 /include/linux/compiler_types.h
parentf44ca0871b7a98b075560711d48849914a102221 (diff)
ctype.h: remove duplicate isdigit() helper
gcc warns a few thousand times about the isdigit() shadow: include/linux/ctype.h:26:19: warning: declaration of 'isdigit' shadows a built-in function [-Wshadow] As there is already a compiler builtin, just use that, and make it clear we do that by defining a macro. Unfortunately, clang does not have the isdigit() builtin, so this has to be conditional. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'include/linux/compiler_types.h')
-rw-r--r--include/linux/compiler_types.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h
index 6e390d58a9f8..5d41dff3f79c 100644
--- a/include/linux/compiler_types.h
+++ b/include/linux/compiler_types.h
@@ -64,6 +64,17 @@ static inline void __chk_io_ptr(const volatile void __iomem *ptr) { }
/* Attributes */
#include <linux/compiler_attributes.h>
+/* Builtins */
+
+/*
+ * __has_builtin is supported on gcc >= 10, clang >= 3 and icc >= 21.
+ * In the meantime, to support gcc < 10, we implement __has_builtin
+ * by hand.
+ */
+#ifndef __has_builtin
+#define __has_builtin(x) (0)
+#endif
+
/* Compiler specific macros. */
#ifdef __clang__
#include <linux/compiler-clang.h>