Ensure assert_fail and abort have noreturn attribute

This commit is contained in:
Jeremy Soller
2023-03-10 11:23:56 -07:00
parent 334e33cfde
commit e7b70fdb93
9 changed files with 275 additions and 112 deletions
+5 -7
View File
@@ -1,16 +1,14 @@
#ifndef _BITS_STDLIB_H
#define _BITS_STDLIB_H
#ifdef __cplusplus
extern "C" {
// C++ needs abort to be a function, and cannot use this
#ifndef __cplusplus
// Override abort function with detailed abort in C
#define abort() __abort(__func__, __FILE__, __LINE__)
#endif
#ifdef __cplusplus
// C++ needs abort to be a function, define backup function
void abort(void);
#else
// C uses detailed abort macro
#define abort() __abort(__func__, __FILE__, __LINE__)
extern "C" {
#endif
long double strtold(const char *nptr, char **endptr);