From 6c3b7c1d0e97316c36881f3e2a4c19043921addb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 6 Jan 2015 15:14:15 +0100 Subject: [PATCH] CheckBufferOverrun: only report warnings when --enable=warning has been used --- lib/checkbufferoverrun.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/checkbufferoverrun.cpp b/lib/checkbufferoverrun.cpp index 3ac75db37..ef4e757ec 100644 --- a/lib/checkbufferoverrun.cpp +++ b/lib/checkbufferoverrun.cpp @@ -85,6 +85,8 @@ void CheckBufferOverrun::arrayIndexOutOfBoundsError(const Token *tok, const Arra } if (condition != nullptr) { + if (!_settings->isEnabled("warning")) + return; errmsg << " Otherwise condition '" << condition->expressionString() << "' is redundant."; std::list callstack; callstack.push_back(tok);