From d261db447b01d0b50fef5d930d0a4ece61fb5f1d Mon Sep 17 00:00:00 2001 From: Lephenixnoir Date: Sun, 30 May 2021 08:59:06 +0200 Subject: [PATCH] add some function attributes --- include/setjmp.h | 2 ++ include/stdlib.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/include/setjmp.h b/include/setjmp.h index 73fe01c..e9038e6 100644 --- a/include/setjmp.h +++ b/include/setjmp.h @@ -9,12 +9,14 @@ typedef struct __jmp_buf jmp_buf[1]; /* Save the calling environment in __env (not the signal mask), return 0. */ +__attribute__((returns_twice)) extern int setjmp(jmp_buf __env); /* Standard requires setjmp to be a macro (7.13ยง1) */ #define setjmp setjmp /* Restore the calling environment from __env, return __val to setjmp. */ +__attribute__((noreturn)) extern void longjmp(jmp_buf __env, int __val); #endif /*__SETJMP_H__*/ diff --git a/include/stdlib.h b/include/stdlib.h index 5f68ab0..5b54c43 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -31,12 +31,15 @@ extern void free(void *__ptr); /* Communication with the environment. */ /* Abort execution; raises SIGABRT and leaves quickly with _Exit(). */ +__attribute__((noreturn)) void abort(void); /* Exit; calls handlers, flushes and closes streams and temporary files. */ +__attribute__((noreturn)) void exit(int __status); /* Exit immediately, bypassing exit handlers or signal handlers. */ +__attribute__((noreturn)) void _Exit(int __status); /* Integer arithmetic functions. */