Commit fe8a1544 authored by Miguel Ojeda's avatar Miguel Ojeda Committed by Greg Kroah-Hartman
Browse files

FROMLIST: compiler_types: mark __compiletime_assert failure as __noreturn

`__compiletime_assert` declares a fake `extern` function
which appears (to the compiler) to be called when the test fails.

Therefore, compilers may emit possibly-uninitialized warnings
in some cases, even if it will be an error anyway (for compilers
supporting the `error` attribute, e.g. GCC and Clang >= 14)
or a link failure (for those that do not, e.g. Clang < 14).

Annotating the fake function as `__noreturn` gives them
the information they need to avoid the warning,
e.g. see https://godbolt.org/z/x1v69jjYY.

Link: https://lore.kernel.org/llvm/202110100514.3h9CI4s0-lkp@intel.com/


Reported-by: default avatarkernel test robot <lkp@intel.com>
Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
Reviewed-by: default avatarNathan Chancellor <nathan@kernel.org>
Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
Change-Id: I6aaf5325bc7821cafda8fea501e8e304750ad84a
Fixes: a1cb8029 ("Merge 57a315cd ("Merge tag 'timers-core-2021-10-31' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip"

) into android-mainline")
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent a1cb8029
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment