Skip to content

Commit 993664a

Browse files
committed
store all errors in AnalyzerInfo even if suppressed [skip ci]
1 parent 45e0eb0 commit 993664a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lib/cppcheck.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ class CppCheck::CppCheckLogger : public ErrorLogger
177177
// TODO: only convert if necessary
178178
const auto errorMessage = SuppressionList::ErrorMessage::fromErrorMessage(msg, macroNames);
179179

180+
bool suppressed = false;
181+
180182
if (mSuppressions.nomsg.isSuppressed(errorMessage, mUseGlobalSuppressions)) {
181183
// Safety: Report critical errors to ErrorLogger
182184
if (mSettings.safety && ErrorLogger::isCriticalErrorId(msg.id)) {
@@ -193,7 +195,7 @@ class CppCheck::CppCheckLogger : public ErrorLogger
193195
mErrorLogger.reportErr(msg);
194196
}
195197
}
196-
return;
198+
suppressed = true;
197199
}
198200

199201
// TODO: there should be no need for the verbose and default messages here
@@ -210,6 +212,9 @@ class CppCheck::CppCheckLogger : public ErrorLogger
210212
if (mAnalyzerInformation)
211213
mAnalyzerInformation->reportErr(msg);
212214

215+
if (suppressed)
216+
return;
217+
213218
if (!mSuppressions.nofail.isSuppressed(errorMessage) && !mSuppressions.nomsg.isSuppressed(errorMessage)) {
214219
mExitCode = 1;
215220
}

0 commit comments

Comments
 (0)