From 658060196931d88040f658f3ce51d03b36a77b21 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Sat, 15 Apr 2023 22:50:27 +0200 Subject: [PATCH] Add M_ATTR_NO_RETURN attribute support (not C23 compatible yet) --- m-core.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/m-core.h b/m-core.h index 09c634ff..cd83bfb9 100644 --- a/m-core.h +++ b/m-core.h @@ -121,6 +121,14 @@ # define M_ATTR_EXTENSION #endif +/* Extension attribute for no return function */ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L +# define M_ATTR_NO_RETURN _Noreturn +#elif defined(__GNUC__) +# define M_ATTR_NO_RETURN __attribute__ ((noreturn)) +#else +# define M_ATTR_NO_RETURN +#endif /* Ignore some warnings detected by some compilers in the library. * Whatever we do, there is some warnings that cannot be fixed.