From c27a89971805b176dcfa5a234f2ea6f6109d0a70 Mon Sep 17 00:00:00 2001 From: Lexi Winter Date: Fri, 2 Feb 2024 09:41:40 -0700 Subject: [PATCH] stdlib.h: add __noexcept to prototypes The noexcept specifier is required on these functions in C++: _Exit(), atexit(), quick_exit(), at_quick_exit(), abort(). MFC after: 2 weeks Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1085 --- include/stdlib.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/stdlib.h b/include/stdlib.h index ff8991d1fa94..f0687f01e6c7 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -84,9 +84,9 @@ extern int __mb_cur_max; extern int ___mb_cur_max(void); #define MB_CUR_MAX ((size_t)___mb_cur_max()) -_Noreturn void abort(void); +_Noreturn void abort(void) __noexcept; int abs(int) __pure2; -int atexit(void (* _Nonnull)(void)); +int atexit(void (* _Nonnull)(void)) __noexcept; double atof(const char *); int atoi(const char *); long atol(const char *); @@ -154,7 +154,7 @@ unsigned long long strtoull(const char * __restrict, char ** __restrict, int); #endif /* __LONG_LONG_SUPPORTED */ -_Noreturn void _Exit(int); +_Noreturn void _Exit(int) __noexcept; #endif /* __ISO_C_VISIBLE >= 1999 */ /* @@ -163,9 +163,9 @@ _Noreturn void _Exit(int); #if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L void * aligned_alloc(size_t, size_t) __malloc_like __alloc_align(1) __alloc_size(2); -int at_quick_exit(void (*)(void)); +int at_quick_exit(void (*)(void)) __noexcept; _Noreturn void - quick_exit(int); + quick_exit(int) __noexcept; #endif /* __ISO_C_VISIBLE >= 2011 */ /* * Extensions made by POSIX relative to C.