summaryrefslogtreecommitdiff
path: root/include/panic.h
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2020-07-28 11:54:18 -0700
committerCommit Bot <commit-bot@chromium.org>2020-08-17 20:14:48 +0000
commit84c97f043260e0b06b585ae2a46cc4e9977e0ccd (patch)
treef0dc2821c9df89780f98b6ab0b98b236056eda06 /include/panic.h
parentaca8db3d63a3521784d5b6ca38f285bc7680404d (diff)
downloadchrome-ec-84c97f043260e0b06b585ae2a46cc4e9977e0ccd.tar.gz
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 <tomhughes@chromium.org> Change-Id: I30361bb5290cea1c776a7356f7e3a68edf1f8e39 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2324816 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'include/panic.h')
-rw-r--r--include/panic.h14
1 files changed, 7 insertions, 7 deletions
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 <stdarg.h>
#include <stdint.h>
+#include <stdnoreturn.h>
#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