Skip to content

Commit 48fbee9

Browse files
authored
Merge pull request #781 from rstahn/patch-1
Extend UNITY_NORETURN mapping for (older) IAR compilers
2 parents 9578ffd + 3fb2484 commit 48fbee9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/unity_internals.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@
8787
/* Since C23, the keyword _Noreturn has been replaced by the attribute noreturn, based on: */
8888
/* https://en.cppreference.com/w/c/language/attributes/noreturn */
8989
#define UNITY_NORETURN [[ noreturn ]]
90+
#elif defined(__IAR_SYSTEMS_ICC__) && (__IAR_SYSTEMS_ICC__ >= 8)
91+
/* For IAR compilers supporting at least C99 use the IAR specific '__noreturn' keyword */
92+
/* Based on tests and: */
93+
/* https://wwwfiles.iar.com/arm/webic/doc/EWARM_DevelopmentGuide.ENU.pdf */
94+
/* https://wwwfiles.iar.com/AVR/webic/doc/EWAVR_CompilerGuide.pdf */
95+
/* https://wwwfiles.iar.com/msp430/webic/doc/EW430_CompilerReference.pdf */
96+
#define UNITY_NORETURN __noreturn
9097
#endif
9198
#endif
9299
#ifndef UNITY_NORETURN

0 commit comments

Comments
 (0)