]> git.baikalelectronics.ru Git - kernel.git/commit
compiler_attributes.h: move __compiletime_{error|warning}
authorNick Desaulniers <ndesaulniers@google.com>
Mon, 2 Aug 2021 20:23:20 +0000 (13:23 -0700)
committerMiguel Ojeda <ojeda@kernel.org>
Wed, 8 Sep 2021 23:14:28 +0000 (01:14 +0200)
commit3b967563892c1c424dd581abe365d0946bfbbd06
tree2795a8bbc93b56fd96b8663d6b1b97d321d713eb
parent939205978320649d96cb5001523d5b968ebf7e6f
compiler_attributes.h: move __compiletime_{error|warning}

Clang 14 will add support for __attribute__((__error__(""))) and
__attribute__((__warning__(""))). To make use of these in
__compiletime_error and __compiletime_warning (as used by BUILD_BUG and
friends) for newer clang and detect/fallback for older versions of
clang, move these to compiler_attributes.h and guard them with
__has_attribute preprocessor guards.

Link: https://reviews.llvm.org/D106030
Link: https://bugs.llvm.org/show_bug.cgi?id=16428
Link: https://github.com/ClangBuiltLinux/linux/issues/1173
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
[Reworded, landed in Clang 14]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
include/linux/compiler-gcc.h
include/linux/compiler_attributes.h
include/linux/compiler_types.h