From 3fb2484313aa550c274203fe59457bf33f76596b Mon Sep 17 00:00:00 2001 From: Roland Stahn Date: Tue, 27 May 2025 14:33:15 +0200 Subject: [PATCH] Add IAR specific mapping for UNITY_NORETURN --- src/unity_internals.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/unity_internals.h b/src/unity_internals.h index 562f5b6..97fc9b4 100644 --- a/src/unity_internals.h +++ b/src/unity_internals.h @@ -87,6 +87,13 @@ /* Since C23, the keyword _Noreturn has been replaced by the attribute noreturn, based on: */ /* https://en.cppreference.com/w/c/language/attributes/noreturn */ #define UNITY_NORETURN [[ noreturn ]] + #elif defined(__IAR_SYSTEMS_ICC__) && (__IAR_SYSTEMS_ICC__ >= 8) + /* For IAR compilers supporting at least C99 use the IAR specific '__noreturn' keyword */ + /* Based on tests and: */ + /* https://wwwfiles.iar.com/arm/webic/doc/EWARM_DevelopmentGuide.ENU.pdf */ + /* https://wwwfiles.iar.com/AVR/webic/doc/EWAVR_CompilerGuide.pdf */ + /* https://wwwfiles.iar.com/msp430/webic/doc/EW430_CompilerReference.pdf */ + #define UNITY_NORETURN __noreturn #endif #endif #ifndef UNITY_NORETURN