From d0e1eb7a7bbe3e0f66c0637665385651b830287d Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 3 May 2020 11:20:23 +0200 Subject: [PATCH] mark abort() function as noreturn. It was not specified as such before C11, but that's only because there was no C standard way to do it until then. Fixes #15955. Change-Id: Ied7b7fd94988ed7724460917aebc859b74eaa585 Reviewed-on: https://review.haiku-os.org/c/haiku/+/2558 Reviewed-by: waddlesplash --- headers/posix/stdlib.h | 2 +- src/system/kernel/util/kernel_cpp.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/headers/posix/stdlib.h b/headers/posix/stdlib.h index d1db4ab5db..4890caf0a2 100644 --- a/headers/posix/stdlib.h +++ b/headers/posix/stdlib.h @@ -52,7 +52,7 @@ extern int posix_memalign(void **_pointer, size_t alignment, size_t size); extern void *realloc(void *oldPointer, size_t newSize); /* process termination */ -extern void abort(void); +extern void abort(void) __attribute__((noreturn)); extern int atexit(void (*func)(void)); extern int atfork(void (*func)(void)); extern void exit(int) __attribute__((noreturn)); diff --git a/src/system/kernel/util/kernel_cpp.cpp b/src/system/kernel/util/kernel_cpp.cpp index 62f098b8d7..db28cb958f 100644 --- a/src/system/kernel/util/kernel_cpp.cpp +++ b/src/system/kernel/util/kernel_cpp.cpp @@ -381,7 +381,8 @@ extern "C" void abort() { - panic("abort() called!"); + while (true) + panic("abort() called!"); }