From 212f4a561c3abca57e262272b832ac3d09885692 Mon Sep 17 00:00:00 2001 From: Evan Nemerson Date: Thu, 19 Sep 2024 21:03:24 -0400 Subject: [PATCH] fix: silence a warning from some versions of ICX There is a -Wpre-c11-compat warning which is emitted when icx sees a _Noreturn keyword (which is a new feature of C11). The Hedley macro already handles emitting it only if the compiler claims C11 compatibility, --- hedley.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hedley.h b/hedley.h index d084c7a..21771d6 100644 --- a/hedley.h +++ b/hedley.h @@ -1184,7 +1184,15 @@ HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) # define HEDLEY_NO_RETURN __attribute__((__noreturn__)) #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L -# define HEDLEY_NO_RETURN _Noreturn +# if HEDLEY_HAS_WARNING("-Wpre-c11-compat") +# define HEDLEY_NO_RETURN \ + HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wpre-c11-compat\"") \ + _Noreturn \ + HEDLEY_DIAGNOSTIC_POP +# else +# define HEDLEY_NO_RETURN _Noreturn +# endif #elif defined(__cplusplus) && (__cplusplus >= 201103L) # define HEDLEY_NO_RETURN HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[noreturn]]) #elif \