From 997207d9a663a74a5b1ed4499fd7b1ce83494d78 Mon Sep 17 00:00:00 2001 From: Alan Green Date: Thu, 16 May 2019 08:52:12 +1000 Subject: src/include/assert.h: add noreturn attribute to dead_code() Clang does not recognize dead_code() as termination of execution. It gives this message: error: control reaches end of non-void function [-Werror,-Wreturn-type] This change adds an __attribute__((noreturn)) to ensure that clang recognises that this function will terminate execution. This change is more general solution to the problem that was addressed in the specific at https://review.coreboot.org/c/coreboot/+/32798 Signed-off-by: Alan Green Change-Id: I5ba7189559aa01545d5bbe893bced400a3aaabbb Reviewed-on: https://review.coreboot.org/c/coreboot/+/32833 Tested-by: build bot (Jenkins) Reviewed-by: Julius Werner --- src/include/assert.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/include/assert.h b/src/include/assert.h index 4575a29e44..e0db0bc05c 100644 --- a/src/include/assert.h +++ b/src/include/assert.h @@ -56,7 +56,8 @@ * bootmode.c:42: undefined reference to `dead_code_assertion_failed_at_line_42' */ #define __dead_code(line) do { \ - extern void dead_code_assertion_failed_at_line_##line(void); \ + extern void dead_code_assertion_failed_at_line_##line(void) \ + __attribute__((noreturn)); \ dead_code_assertion_failed_at_line_##line(); \ } while (0) #define _dead_code(line) __dead_code(line) -- cgit v1.2.3