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;