From c8ea985748a6857ac5db9ef50f9c92e2966c04d5 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 6 Sep 2012 23:12:27 -0400 Subject: add _Noreturn function attribute, with fallback for pre-C11 GNUC --- include/setjmp.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'include/setjmp.h') diff --git a/include/setjmp.h b/include/setjmp.h index 7dc72767..8ec5c6f1 100644 --- a/include/setjmp.h +++ b/include/setjmp.h @@ -5,6 +5,13 @@ extern "C" { #endif +#if __STDC_VERSION__ >= 201112L +#elif defined(__GNUC__) +#define _Noreturn __attribute__((__noreturn__)) +#else +#define _Noreturn +#endif + #include @@ -29,7 +36,7 @@ void _longjmp (jmp_buf, int); int setjmp (jmp_buf); -void longjmp (jmp_buf, int); +_Noreturn void longjmp (jmp_buf, int); #define setjmp setjmp #define longjmp longjmp -- cgit v1.2.1