summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2021-11-07 21:38:17 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2021-11-07 21:38:17 +0300
commite54ffb96e6f41eb5ca2f89788f95224273ce09f1 (patch)
tree88fa05d4b717ea8d12fbb762dec4782673440e22 /include
parentb5013d084e03e82ceeab4db8ae8ceeaebe76b0eb (diff)
parent7c00621dcaeea206d7489b3e8b50b1864841ae69 (diff)
downloadlinux-e54ffb96e6f41eb5ca2f89788f95224273ce09f1.tar.xz
Merge tag 'compiler-attributes-for-linus-v5.16' of git://github.com/ojeda/linux
Pull compiler attributes update from Miguel Ojeda: "An improvement for `__compiletime_assert` and a trivial cleanup" * tag 'compiler-attributes-for-linus-v5.16' of git://github.com/ojeda/linux: compiler_types: mark __compiletime_assert failure as __noreturn Compiler Attributes: remove GCC 5.1 mention
Diffstat (limited to 'include')
-rw-r--r--include/linux/compiler_attributes.h1
-rw-r--r--include/linux/compiler_types.h8
2 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/compiler_attributes.h b/include/linux/compiler_attributes.h
index 3de06a8fae73..b9121afd8733 100644
--- a/include/linux/compiler_attributes.h
+++ b/include/linux/compiler_attributes.h
@@ -113,7 +113,6 @@
#define __deprecated
/*
- * Optional: only supported since gcc >= 5.1
* Optional: not supported by clang
* Optional: not supported by icc
*
diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h
index 3f198879c292..1d32f4c03c9e 100644
--- a/include/linux/compiler_types.h
+++ b/include/linux/compiler_types.h
@@ -305,7 +305,13 @@ struct ftrace_likely_data {
#ifdef __OPTIMIZE__
# define __compiletime_assert(condition, msg, prefix, suffix) \
do { \
- extern void prefix ## suffix(void) __compiletime_error(msg); \
+ /* \
+ * __noreturn is needed to give the compiler enough \
+ * information to avoid certain possibly-uninitialized \
+ * warnings (regardless of the build failing). \
+ */ \
+ __noreturn extern void prefix ## suffix(void) \
+ __compiletime_error(msg); \
if (!(condition)) \
prefix ## suffix(); \
} while (0)