diff --git a/src/lib/support/PersistedCounter.h b/src/lib/support/PersistedCounter.h index 24640d24057f20..77edfdeed2157e 100644 --- a/src/lib/support/PersistedCounter.h +++ b/src/lib/support/PersistedCounter.h @@ -229,6 +229,11 @@ class PersistedCounter : public MonotonicallyIncreasingCounter T valueLE = GetInitialCounterValue(); uint16_t size = sizeof(valueLE); + // clang-tidy claims that we're returning without writing to 'aStartValue', + // assign 0 to supppress the warning. In case of error, the value wont't be + // used anyway. + aStartValue = 0; + VerifyOrReturnError(mKey.IsInitialized(), CHIP_ERROR_INCORRECT_STATE); CHIP_ERROR err = mStorage->SyncGetKeyValue(mKey.KeyName(), &valueLE, size);