@@ -305,9 +305,9 @@ int CppCheckExecutor::check_wrapper(CppCheck& cppcheck)
305
305
return check_internal (cppcheck);
306
306
}
307
307
308
- 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) {
309
- const auto & suppressions = settings. nomsg .getSuppressions ();
310
- if (std::any_of (suppressions .begin (), suppressions .end (), [](const Suppressions::Suppression& s) {
308
+ 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) {
309
+ const auto & suppr = suppressions .getSuppressions ();
310
+ if (std::any_of (suppr .begin (), suppr .end (), [](const Suppressions::Suppression& s) {
311
311
return s.errorId == " unmatchedSuppression" && s.fileName .empty () && s.lineNumber == Suppressions::Suppression::NO_LINE;
312
312
}))
313
313
return false ;
@@ -319,15 +319,15 @@ bool CppCheckExecutor::reportSuppressions(const Settings &settings, bool unusedF
319
319
320
320
for (std::list<std::pair<std::string, std::size_t >>::const_iterator i = files.cbegin (); i != files.cend (); ++i) {
321
321
err |= Suppressions::reportUnmatchedSuppressions (
322
- settings. nomsg .getUnmatchedLocalSuppressions (i->first , unusedFunctionCheckEnabled), errorLogger);
322
+ suppressions .getUnmatchedLocalSuppressions (i->first , unusedFunctionCheckEnabled), errorLogger);
323
323
}
324
324
325
325
for (std::list<FileSettings>::const_iterator i = fileSettings.cbegin (); i != fileSettings.cend (); ++i) {
326
326
err |= Suppressions::reportUnmatchedSuppressions (
327
- settings. nomsg .getUnmatchedLocalSuppressions (i->filename , unusedFunctionCheckEnabled), errorLogger);
327
+ suppressions .getUnmatchedLocalSuppressions (i->filename , unusedFunctionCheckEnabled), errorLogger);
328
328
}
329
329
}
330
- err |= Suppressions::reportUnmatchedSuppressions (settings. nomsg .getUnmatchedGlobalSuppressions (unusedFunctionCheckEnabled), errorLogger);
330
+ err |= Suppressions::reportUnmatchedSuppressions (suppressions .getUnmatchedGlobalSuppressions (unusedFunctionCheckEnabled), errorLogger);
331
331
return err;
332
332
}
333
333
@@ -378,7 +378,7 @@ int CppCheckExecutor::check_internal(CppCheck& cppcheck)
378
378
cppcheck.analyseWholeProgram (settings.buildDir , mFiles , mFileSettings );
379
379
380
380
if (settings.severity .isEnabled (Severity::information) || settings.checkConfiguration ) {
381
- const bool err = reportSuppressions (settings, cppcheck.isUnusedFunctionCheckEnabled (), mFiles , mFileSettings , *this );
381
+ const bool err = reportSuppressions (settings, settings. nomsg , cppcheck.isUnusedFunctionCheckEnabled (), mFiles , mFileSettings , *this );
382
382
if (err && returnValue == 0 )
383
383
returnValue = settings.exitCode ;
384
384
}
0 commit comments