Skip to content

Commit 6c3b7c1

Browse files
committed
CheckBufferOverrun: only report warnings when --enable=warning has been used
1 parent 228f596 commit 6c3b7c1

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/checkbufferoverrun.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ void CheckBufferOverrun::arrayIndexOutOfBoundsError(const Token *tok, const Arra
8585
}
8686

8787
if (condition != nullptr) {
88+
if (!_settings->isEnabled("warning"))
89+
return;
8890
errmsg << " Otherwise condition '" << condition->expressionString() << "' is redundant.";
8991
std::list<const Token *> callstack;
9092
callstack.push_back(tok);

0 commit comments

Comments
 (0)