diff --git a/UNITTESTS/target_h/platform/mbed_assert.h b/UNITTESTS/target_h/platform/mbed_assert.h index c52a0173e2..3d7a8a24d8 100644 --- a/UNITTESTS/target_h/platform/mbed_assert.h +++ b/UNITTESTS/target_h/platform/mbed_assert.h @@ -39,7 +39,12 @@ extern "C" { * @param file File where assertation failed. * @param line Failing assertation line number. */ -MBED_NORETURN void mbed_assert_internal(const char *expr, const char *file, int line); +// mbed_assert_internal UT stub only prints an assert trace and returns, so therefore +// MBED_NORETURN must not be defined for UTs. +#ifndef UNITTEST +MBED_NORETURN +#endif +void mbed_assert_internal(const char *expr, const char *file, int line); #ifdef __cplusplus } @@ -132,4 +137,3 @@ do { \ /**@}*/ /**@}*/ -