From 84c97f043260e0b06b585ae2a46cc4e9977e0ccd Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 28 Jul 2020 11:54:18 -0700 Subject: Replace __attribute__((noreturn)) with noreturn _Noreturn was added in C11 and the convenience macro "noreturn" is specified by stdnoreturn.h: https://en.cppreference.com/w/c/language/_Noreturn. BRANCH=none BUG=none TEST=make buildall -j Signed-off-by: Tom Hughes Change-Id: I30361bb5290cea1c776a7356f7e3a68edf1f8e39 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2324816 Reviewed-by: Ting Shen --- include/panic.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'include/panic.h') diff --git a/include/panic.h b/include/panic.h index 4708a9ff13..6daa4c408f 100644 --- a/include/panic.h +++ b/include/panic.h @@ -11,6 +11,7 @@ #include #include +#include #include "software_panic.h" @@ -152,11 +153,10 @@ void panic_data_print(const struct panic_data *pdata); * @param linenum Line number where assertion happened */ #ifdef CONFIG_DEBUG_ASSERT_BRIEF -void panic_assert_fail(const char *fname, int linenum) - __attribute__((noreturn)); +noreturn void panic_assert_fail(const char *fname, int linenum); #else -void panic_assert_fail(const char *msg, const char *func, const char *fname, - int linenum) __attribute__((noreturn)); +noreturn void panic_assert_fail(const char *msg, const char *func, + const char *fname, int linenum); #endif /** @@ -164,19 +164,19 @@ void panic_assert_fail(const char *msg, const char *func, const char *fname, * * @param msg Panic message */ -void panic(const char *msg) __attribute__((noreturn)); +noreturn void panic(const char *msg); /** * Display a default message and reset */ -void panic_reboot(void) __attribute__((noreturn)); +noreturn void panic_reboot(void); #ifdef CONFIG_SOFTWARE_PANIC /** * Store a panic log and halt the system for a software-related reason, such as * stack overflow or assertion failure. */ -void software_panic(uint32_t reason, uint32_t info) __attribute__((noreturn)); +noreturn void software_panic(uint32_t reason, uint32_t info); /** * Log a panic in the panic log, but don't halt the system. Normally -- cgit v1.2.1