CheckBufferOverrun: only report warnings when --enable=warning has been used

This commit is contained in:
Daniel Marjamäki 2015-01-06 15:14:15 +01:00
parent 228f5960fc
commit 6c3b7c1d0e
1 changed files with 2 additions and 0 deletions

View File

@ -85,6 +85,8 @@ void CheckBufferOverrun::arrayIndexOutOfBoundsError(const Token *tok, const Arra
} }
if (condition != nullptr) { if (condition != nullptr) {
if (!_settings->isEnabled("warning"))
return;
errmsg << " Otherwise condition '" << condition->expressionString() << "' is redundant."; errmsg << " Otherwise condition '" << condition->expressionString() << "' is redundant.";
std::list<const Token *> callstack; std::list<const Token *> callstack;
callstack.push_back(tok); callstack.push_back(tok);