Skip to content

Commit e54ffb9

Browse files
committed
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
2 parents b5013d0 + 7c00621 commit e54ffb9

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

include/linux/compiler_attributes.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@
113113
#define __deprecated
114114

115115
/*
116-
* Optional: only supported since gcc >= 5.1
117116
* Optional: not supported by clang
118117
* Optional: not supported by icc
119118
*

include/linux/compiler_types.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,13 @@ struct ftrace_likely_data {
305305
#ifdef __OPTIMIZE__
306306
# define __compiletime_assert(condition, msg, prefix, suffix) \
307307
do { \
308-
extern void prefix ## suffix(void) __compiletime_error(msg); \
308+
/* \
309+
* __noreturn is needed to give the compiler enough \
310+
* information to avoid certain possibly-uninitialized \
311+
* warnings (regardless of the build failing). \
312+
*/ \
313+
__noreturn extern void prefix ## suffix(void) \
314+
__compiletime_error(msg); \
309315
if (!(condition)) \
310316
prefix ## suffix(); \
311317
} while (0)

0 commit comments

Comments
 (0)