summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/score/basedefs.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2020-10-06 07:39:44 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-10-10 14:00:37 +0200
commitd7a48e1b259316533a5c775e27934760e1fcd313 (patch)
treeba60f54f4647a8d866395450183ef2551bf9d46d /cpukit/include/rtems/score/basedefs.h
parentgrlib: Add and use irqmp_has_timestamp() (diff)
downloadrtems-d7a48e1b259316533a5c775e27934760e1fcd313.tar.bz2
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.
Diffstat (limited to 'cpukit/include/rtems/score/basedefs.h')
-rw-r--r--cpukit/include/rtems/score/basedefs.h8
1 files changed, 5 insertions, 3 deletions
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