[posix] fix unused variable when log level is less than OT_LOG_LEVEL_CRIT (#6642)

This commit is contained in:
suveshpratapa
2021-05-18 16:58:49 -07:00
committed by GitHub
parent cf21d5760a
commit 313d1f5d15
+5
View File
@@ -78,7 +78,12 @@ otError otPlatSetMcuPowerState(otInstance *aInstance, otPlatMcuPowerState aState
void otPlatAssertFail(const char *aFilename, int aLineNumber)
{
#if OPENTHREAD_CONFIG_LOG_PLATFORM && OPENTHREAD_CONFIG_LOG_LEVEL < OT_LOG_LEVEL_CRIT
OT_UNUSED_VARIABLE(aFilename);
OT_UNUSED_VARIABLE(aLineNumber);
#else
otLogCritPlat("assert failed at %s:%d", aFilename, aLineNumber);
#endif
// For debug build, use assert to genreate a core dump
assert(false);
exit(1);