aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2021-11-07 10:38:17 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2021-11-07 10:38:17 -0800
commite54ffb96e6f41eb5ca2f89788f95224273ce09f1 (patch)
tree88fa05d4b717ea8d12fbb762dec4782673440e22
parentMerge tag '5.16-rc-part1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6 (diff)
parentcompiler_types: mark __compiletime_assert failure as __noreturn (diff)
downloadlinux-dev-e54ffb96e6f41eb5ca2f89788f95224273ce09f1.tar.xz
linux-dev-e54ffb96e6f41eb5ca2f89788f95224273ce09f1.zip
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
-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)