From d7a48e1b259316533a5c775e27934760e1fcd313 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 6 Oct 2020 07:39:44 +0200 Subject: rtems: Improve RTEMS_NO_RETURN attribute Provide RTEMS_NO_RETURN also in case RTEMS_DEBUG is defined to prevent errors like this: error: no return statement in function returning non-void [-Werror=return-type] Use C11 and C++11 standard means to declare a no-return function. Close #4122. --- cpukit/include/rtems/score/basedefs.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'cpukit/include/rtems/score/basedefs.h') diff --git a/cpukit/include/rtems/score/basedefs.h b/cpukit/include/rtems/score/basedefs.h index c31b4ebef7..0244af1471 100644 --- a/cpukit/include/rtems/score/basedefs.h +++ b/cpukit/include/rtems/score/basedefs.h @@ -94,9 +94,11 @@ * can impact the code generated following calls to * rtems_fatal_error_occurred and _Terminate. */ -#if defined(RTEMS_SCHEDSIM) - #define RTEMS_NO_RETURN -#elif defined(__GNUC__) && !defined(RTEMS_DEBUG) +#if __cplusplus >= 201103L + #define RTEMS_NO_RETURN [[noreturn]] +#elif __STDC_VERSION__ >= 201112L + #define RTEMS_NO_RETURN _Noreturn +#elif defined(__GNUC__) #define RTEMS_NO_RETURN __attribute__((__noreturn__)) #else #define RTEMS_NO_RETURN -- cgit v1.2.3