Fixed #11172 (Unmatched suppression for inline suppression even though --suppress=unmatchedSuppression is used)

This commit is contained in:
Daniel Marjamäki 2022-07-12 23:07:57 +02:00
parent f28be6494c
commit 220effee6a
1 changed files with 6 additions and 1 deletions

View File

@ -979,7 +979,12 @@ int CppCheckExecutor::check_internal(CppCheck& cppcheck)
cppcheck.analyseWholeProgram(mSettings->buildDir, mFiles); cppcheck.analyseWholeProgram(mSettings->buildDir, mFiles);
if (settings.severity.isEnabled(Severity::information) || settings.checkConfiguration) { bool suppressUnmatchedSuppressions = false;
for (const Suppressions::Suppression& suppression: settings.nomsg.getSuppressions()) {
if (suppression.errorId == "unmatchedSuppression" && suppression.fileName.empty() && suppression.lineNumber == Suppressions::Suppression::NO_LINE)
suppressUnmatchedSuppressions = true;
}
if (!suppressUnmatchedSuppressions && (settings.severity.isEnabled(Severity::information) || settings.checkConfiguration)) {
const bool enableUnusedFunctionCheck = cppcheck.isUnusedFunctionCheckEnabled(); const bool enableUnusedFunctionCheck = cppcheck.isUnusedFunctionCheckEnabled();
if (settings.jointSuppressionReport) { if (settings.jointSuppressionReport) {