summaryrefslogtreecommitdiff
path: root/include/linux/compiler_attributes.h
diff options
context:
space:
mode:
authorMiguel Ojeda <ojeda@kernel.org>2021-10-14 16:23:31 +0300
committerMiguel Ojeda <ojeda@kernel.org>2021-10-22 02:16:58 +0300
commit7c00621dcaeea206d7489b3e8b50b1864841ae69 (patch)
tree2f3b4b8cc9390b74f0130fee1366bdf4a0211147 /include/linux/compiler_attributes.h
parentd08fd747d0ed682b6c6c280ba454cafcad33563d (diff)
downloadlinux-7c00621dcaeea206d7489b3e8b50b1864841ae69.tar.xz
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: kernel test robot <lkp@intel.com> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'include/linux/compiler_attributes.h')
0 files changed, 0 insertions, 0 deletions