Skip to content

Commit 88eb14c

Browse files
Albin Ahlbäckalbinahlback
authored andcommitted
Fix function attributes in exception.c
1 parent 4d23943 commit 88eb14c

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

src/generic_files/exception.c

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@
1414
#include <stdarg.h>
1515
#include "flint.h"
1616

17-
#undef FLINT_NORETURN
18-
#if defined(__GNUC__)
19-
# define FLINT_NORETURN __attribute__((noreturn))
20-
#else
21-
# define FLINT_NORETURN
22-
#endif
23-
2417
FLINT_NORETURN static void __flint_throw(flint_err_t, const char *, va_list);
2518

2619
#if FLINT_REENTRANT && !FLINT_USES_TLS && FLINT_USES_PTHREAD
@@ -41,10 +34,10 @@ void __flint_set_throw_init(void)
4134
}
4235
#endif
4336

44-
FLINT_NORETURN void (* abort_func)(void) = abort;
45-
FLINT_NORETURN void (* throw_func)(flint_err_t, const char *, va_list) = __flint_throw;
37+
void (* abort_func)(void) = abort;
38+
void (* throw_func)(flint_err_t, const char *, va_list) = __flint_throw;
4639

47-
void flint_set_abort(void (* func)(void) FLINT_NORETURN)
40+
void flint_set_abort(void (* func)(void))
4841
{
4942
#if FLINT_REENTRANT && !FLINT_USES_TLS && FLINT_USES_PTHREAD
5043
pthread_once(&abort_func_init, __flint_set_abort_init);
@@ -56,7 +49,7 @@ void flint_set_abort(void (* func)(void) FLINT_NORETURN)
5649
#endif
5750
}
5851

59-
void flint_set_throw(void (* func)(flint_err_t, const char *, va_list) FLINT_NORETURN)
52+
void flint_set_throw(void (* func)(flint_err_t, const char *, va_list))
6053
{
6154
#if FLINT_REENTRANT && !FLINT_USES_TLS && FLINT_USES_PTHREAD
6255
pthread_once(&throw_func_init, __flint_set_throw_init);
@@ -116,11 +109,13 @@ FLINT_NORETURN void flint_abort(void)
116109
fflush(stdout);
117110
fflush(stderr);
118111
(*abort_func)();
112+
FLINT_UNREACHABLE;
119113
}
120114

121115
FLINT_NORETURN void flint_throw(flint_err_t exc, const char * msg, ...)
122116
{
123117
va_list ap;
124118
va_start(ap, msg);
125119
(*throw_func)(exc, msg, ap);
120+
FLINT_UNREACHABLE;
126121
}

0 commit comments

Comments
 (0)