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
This commit is contained in:
@@ -113,7 +113,6 @@
|
||||
#define __deprecated
|
||||
|
||||
/*
|
||||
* Optional: only supported since gcc >= 5.1
|
||||
* Optional: not supported by clang
|
||||
* Optional: not supported by icc
|
||||
*
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user