diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 6c58130a0..672d07d0d 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -2458,6 +2458,9 @@ void CheckOther::unusedLabelError(const Token* tok) void CheckOther::checkInvalidTestForOverflow() { + if (!_settings->isEnabled("warning")) + return; + const SymbolDatabase *symbolDatabase = _tokenizer->getSymbolDatabase(); const std::size_t functions = symbolDatabase->functionScopes.size(); for (std::size_t i = 0; i < functions; ++i) {