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
This commit is contained in:
Lexi Winter 2024-02-02 09:41:40 -07:00 committed by Warner Losh
parent 02b0d4b688
commit c27a899718

View File

@ -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.