diff options
author | Alan Green <avg@google.com> | 2019-05-16 08:52:12 +1000 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2019-05-17 07:16:50 +0000 |
commit | 997207d9a663a74a5b1ed4499fd7b1ce83494d78 (patch) | |
tree | a9961f0521392afe87027ed6e443b61aacc1e7d4 | |
parent | 6aca7e6bec07c583de18752aa7a8639b64e9bd93 (diff) | |
download | coreboot-997207d9a663a74a5b1ed4499fd7b1ce83494d78.tar.xz |
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 <avg@google.com>
Change-Id: I5ba7189559aa01545d5bbe893bced400a3aaabbb
Reviewed-on: https://review.coreboot.org/c/coreboot/+/32833
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
-rw-r--r-- | src/include/assert.h | 3 |
1 files changed, 2 insertions, 1 deletions
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) |