Skip to content
Commit b83a9084 authored by Nick Desaulniers's avatar Nick Desaulniers Committed by Miguel Ojeda
Browse files

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: default avatarNick Desaulniers <ndesaulniers@google.com>
Reviewed-by: default avatarNathan Chancellor <nathan@kernel.org>
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
[Reworded, landed in Clang 14]
Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
parent 1ca70b24
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment