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-
2417FLINT_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
121115FLINT_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