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 <[email protected]>
This commit is contained in:
Adrien Destugues
2020-05-03 15:42:41 +00:00
committed by waddlesplash
parent 3268566c20
commit d0e1eb7a7b
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -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));
+2 -1
View File
@@ -381,7 +381,8 @@ extern "C"
void
abort()
{
panic("abort() called!");
while (true)
panic("abort() called!");
}