From a892018926b2dac830e6a409be042de89e5f6514 Mon Sep 17 00:00:00 2001 From: Piotr Tworek Date: Mon, 2 Nov 2020 00:26:02 +0100 Subject: [PATCH] base-hw: Define Entry function as noreturn. Right now the code marks specific instance of this function as noreturn. It then tries to initialize it using a value that has the same type, except for the noreturn part. GCC does not care, but clang complains this technically assigns the value of entry from incompatible pointer type. Fix this by defining Entry function as no return. Issue #3938 --- repos/base-hw/src/bootstrap/platform.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/repos/base-hw/src/bootstrap/platform.cc b/repos/base-hw/src/bootstrap/platform.cc index 112bf21f5a..86584d1f21 100644 --- a/repos/base-hw/src/bootstrap/platform.cc +++ b/repos/base-hw/src/bootstrap/platform.cc @@ -150,9 +150,8 @@ Mapping Platform::_load_elf() void Platform::start_core(unsigned cpu_id) { - typedef void (* Entry)(unsigned); - Entry __attribute__((noreturn)) const entry - = reinterpret_cast(core_elf.entry()); + typedef void (* Entry)(unsigned) __attribute__((noreturn)); + Entry const entry = reinterpret_cast(core_elf.entry()); entry(cpu_id); }