Skip to content

Commit

Permalink
fix: silence a warning from some versions of ICX
Browse files Browse the repository at this point in the history
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,
  • Loading branch information
nemequ committed Sep 20, 2024
1 parent 9d66e09 commit 212f4a5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion hedley.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit 212f4a5

Please sign in to comment.