Skip to content

Commit 5fb4cd1

Browse files
minipli-osswipawel
authored andcommitted
console: make panic()'s declaration noreturn
Instead of attaching the __noreturn annotation to the definition, attach it to the declaration of panic() to make callers aware that this function won't return. Signed-off-by: Mathias Krause <minipli@grsecurity.net>
1 parent 317c75d commit 5fb4cd1

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

common/console.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ void register_console_callback(console_callback_t cb, void *arg) {
122122
console_callbacks[num_console_callbacks++].arg = arg;
123123
}
124124

125-
void __noreturn panic(const char *fmt, ...) {
125+
void panic(const char *fmt, ...) {
126126
va_list args;
127127

128128
printk("************** PANIC **************\n");

include/console.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ extern void fb_console_write(void *arg, const char *buf, size_t len);
5151

5252
extern void register_console_callback(console_callback_t func, void *arg);
5353

54-
extern void panic(const char *fmt, ...);
54+
extern void panic(const char *fmt, ...) __noreturn;
5555
extern void warning(const char *fmt, ...);
5656

5757
#endif /* KTF_CONSOLE_H */

0 commit comments

Comments
 (0)