From caf78f3c9fd7ddbd26b3f6c4b87a98951ad0295a Mon Sep 17 00:00:00 2001 From: Alexander Myltsev Date: Tue, 13 Dec 2022 01:25:27 +0300 Subject: [PATCH] Use __builtin_unreachable. --- drivers/misc.h | 2 +- user/crt.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/misc.h b/drivers/misc.h index 0d790d7..bbb1701 100644 --- a/drivers/misc.h +++ b/drivers/misc.h @@ -4,5 +4,5 @@ __attribute__((noreturn)) static inline void qemu_shutdown() { port_word_out(0x604, 0x2000); - while(1); + __builtin_unreachable(); } diff --git a/user/crt.c b/user/crt.c index 12dd78e..17320ea 100644 --- a/user/crt.c +++ b/user/crt.c @@ -1,7 +1,9 @@ int main(); +_Noreturn void _exit(int exit_status) { asm("int $0x84": : "a"(0), "b"(exit_status)); + __builtin_unreachable(); } void _start() {