From e86abfdc5faee6ab65cfdb5e176023bac1713269 Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Thu, 4 Aug 2011 12:04:38 +0300 Subject: [PATCH] No unmatched suppressions list in quiet output. When user wants to see only errors printed (--quiet in CLI) we must obey that. And not print unmatchedSuppressions list. Ticket: #2895 (Cannot suppress unmatchedSuppression reports) --- cli/cppcheckexecutor.cpp | 3 ++- lib/cppcheck.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cli/cppcheckexecutor.cpp b/cli/cppcheckexecutor.cpp index 6cc824e20..25b486229 100644 --- a/cli/cppcheckexecutor.cpp +++ b/cli/cppcheckexecutor.cpp @@ -189,7 +189,8 @@ int CppCheckExecutor::check(int argc, const char* const argv[]) if (!cppCheck.settings().checkConfiguration) { - reportUnmatchedSuppressions(cppCheck.settings().nomsg.getUnmatchedGlobalSuppressions()); + if (!_settings._errorsOnly) + reportUnmatchedSuppressions(cppCheck.settings().nomsg.getUnmatchedGlobalSuppressions()); if (Preprocessor::missingIncludeFlag) { diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index 53654bf0c..25f38c9d2 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -189,7 +189,8 @@ unsigned int CppCheck::processFile() _errorLogger.reportOut("Bailing out from checking " + fixedpath + ": " + e.what()); } - reportUnmatchedSuppressions(_settings.nomsg.getUnmatchedLocalSuppressions(_filename)); + if (!_settings._errorsOnly) + reportUnmatchedSuppressions(_settings.nomsg.getUnmatchedLocalSuppressions(_filename)); _errorList.clear(); return exitcode;