@@ -218,9 +218,9 @@ int CppCheckExecutor::check_wrapper(CppCheck& cppcheck)
218
218
return check_internal (cppcheck);
219
219
}
220
220
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) {
224
224
return s.errorId == " unmatchedSuppression" && s.fileName .empty () && s.lineNumber == Suppressions::Suppression::NO_LINE;
225
225
}))
226
226
return false ;
@@ -232,15 +232,15 @@ bool CppCheckExecutor::reportSuppressions(const Settings &settings, bool unusedF
232
232
233
233
for (std::list<std::pair<std::string, std::size_t >>::const_iterator i = files.cbegin (); i != files.cend (); ++i) {
234
234
err |= Suppressions::reportUnmatchedSuppressions (
235
- settings. nomsg .getUnmatchedLocalSuppressions (i->first , unusedFunctionCheckEnabled), errorLogger);
235
+ suppressions .getUnmatchedLocalSuppressions (i->first , unusedFunctionCheckEnabled), errorLogger);
236
236
}
237
237
238
238
for (std::list<FileSettings>::const_iterator i = fileSettings.cbegin (); i != fileSettings.cend (); ++i) {
239
239
err |= Suppressions::reportUnmatchedSuppressions (
240
- settings. nomsg .getUnmatchedLocalSuppressions (i->filename , unusedFunctionCheckEnabled), errorLogger);
240
+ suppressions .getUnmatchedLocalSuppressions (i->filename , unusedFunctionCheckEnabled), errorLogger);
241
241
}
242
242
}
243
- err |= Suppressions::reportUnmatchedSuppressions (settings. nomsg .getUnmatchedGlobalSuppressions (unusedFunctionCheckEnabled), errorLogger);
243
+ err |= Suppressions::reportUnmatchedSuppressions (suppressions .getUnmatchedGlobalSuppressions (unusedFunctionCheckEnabled), errorLogger);
244
244
return err;
245
245
}
246
246
@@ -286,7 +286,7 @@ int CppCheckExecutor::check_internal(CppCheck& cppcheck) const
286
286
cppcheck.analyseWholeProgram (settings.buildDir , mFiles , mFileSettings );
287
287
288
288
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 );
290
290
if (err && returnValue == 0 )
291
291
returnValue = settings.exitCode ;
292
292
}
0 commit comments