Commit e133c33e authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Greg Kroah-Hartman

lib/ubsan.c: don't mark __ubsan_handle_builtin_unreachable as noreturn

commit 1c23b4108d716cc848b38532063a8aca4f86add8 upstream.

gcc-8 complains about the prototype for this function:

  lib/ubsan.c:432:1: error: ignoring attribute 'noreturn' in declaration of a built-in function '__ubsan_handle_builtin_unreachable' because it conflicts with attribute 'const' [-Werror=attributes]

This is actually a GCC's bug. In GCC internals
__ubsan_handle_builtin_unreachable() declared with both 'noreturn' and
'const' attributes instead of only 'noreturn':

Workaround this by removing the noreturn attribute.

[aryabinin: add information about GCC bug in changelog]
Link: default avatarArnd Bergmann <>
Signed-off-by: default avatarAndrey Ryabinin <>
Acked-by: default avatarOlof Johansson <>
Cc: <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 8f1756ad
......@@ -451,8 +451,7 @@ void __ubsan_handle_shift_out_of_bounds(struct shift_out_of_bounds_data *data,
void __noreturn
__ubsan_handle_builtin_unreachable(struct unreachable_data *data)
void __ubsan_handle_builtin_unreachable(struct unreachable_data *data)
unsigned long flags;
Markdown is supported
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