-
由 Nick Desaulniers 提交于
stable inclusion from stable-v5.10.148 commit 6df7c6d141ec3643901f67d2537203cf073d358f category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I6D0WL Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=6df7c6d141ec3643901f67d2537203cf073d358f -------------------------------- commit b83a9084 upstream. 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/1173Signed-off-by: NNick Desaulniers <ndesaulniers@google.com> Reviewed-by: NNathan Chancellor <nathan@kernel.org> Reviewed-by: NKees Cook <keescook@chromium.org> [Reworded, landed in Clang 14] Signed-off-by: NMiguel Ojeda <ojeda@kernel.org> Signed-off-by: NBart Van Assche <bvanassche@acm.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NJialin Zhang <zhangjialin11@huawei.com> Reviewed-by: NZheng Zengkai <zhengzengkai@huawei.com>
1d189d68