@@ -218,9 +218,9 @@ int CppCheckExecutor::check_wrapper(CppCheck& cppcheck)
218218 return check_internal (cppcheck);
219219}
220220
221- bool CppCheckExecutor::reportSuppressions (const Settings &settings, bool unusedFunctionCheckEnabled, const std::list<std::pair<std::string, std::size_t >> &files, const std::list<FileSettings>& fileSettings, ErrorLogger& errorLogger) {
222- const auto & suppressions = settings. nomsg .getSuppressions ();
223- if (std::any_of (suppressions .begin (), suppressions .end (), [](const Suppressions::Suppression& s) {
221+ bool CppCheckExecutor::reportSuppressions (const Settings &settings, const Suppressions& suppressions, bool unusedFunctionCheckEnabled, const std::list<std::pair<std::string, std::size_t >> &files, const std::list<FileSettings>& fileSettings, ErrorLogger& errorLogger) {
222+ const auto & suppr = suppressions .getSuppressions ();
223+ if (std::any_of (suppr .begin (), suppr .end (), [](const Suppressions::Suppression& s) {
224224 return s.errorId == " unmatchedSuppression" && s.fileName .empty () && s.lineNumber == Suppressions::Suppression::NO_LINE;
225225 }))
226226 return false ;
@@ -232,15 +232,15 @@ bool CppCheckExecutor::reportSuppressions(const Settings &settings, bool unusedF
232232
233233 for (std::list<std::pair<std::string, std::size_t >>::const_iterator i = files.cbegin (); i != files.cend (); ++i) {
234234 err |= Suppressions::reportUnmatchedSuppressions (
235- settings. nomsg .getUnmatchedLocalSuppressions (i->first , unusedFunctionCheckEnabled), errorLogger);
235+ suppressions .getUnmatchedLocalSuppressions (i->first , unusedFunctionCheckEnabled), errorLogger);
236236 }
237237
238238 for (std::list<FileSettings>::const_iterator i = fileSettings.cbegin (); i != fileSettings.cend (); ++i) {
239239 err |= Suppressions::reportUnmatchedSuppressions (
240- settings. nomsg .getUnmatchedLocalSuppressions (i->filename , unusedFunctionCheckEnabled), errorLogger);
240+ suppressions .getUnmatchedLocalSuppressions (i->filename , unusedFunctionCheckEnabled), errorLogger);
241241 }
242242 }
243- err |= Suppressions::reportUnmatchedSuppressions (settings. nomsg .getUnmatchedGlobalSuppressions (unusedFunctionCheckEnabled), errorLogger);
243+ err |= Suppressions::reportUnmatchedSuppressions (suppressions .getUnmatchedGlobalSuppressions (unusedFunctionCheckEnabled), errorLogger);
244244 return err;
245245}
246246
@@ -286,7 +286,7 @@ int CppCheckExecutor::check_internal(CppCheck& cppcheck) const
286286 cppcheck.analyseWholeProgram (settings.buildDir , mFiles , mFileSettings );
287287
288288 if (settings.severity .isEnabled (Severity::information) || settings.checkConfiguration ) {
289- const bool err = reportSuppressions (settings, cppcheck.isUnusedFunctionCheckEnabled (), mFiles , mFileSettings , *mStdLogger );
289+ const bool err = reportSuppressions (settings, settings. nomsg , cppcheck.isUnusedFunctionCheckEnabled (), mFiles , mFileSettings , *mStdLogger );
290290 if (err && returnValue == 0 )
291291 returnValue = settings.exitCode ;
292292 }
0 commit comments