Skip to content

Commit 6003364

Browse files
committed
Add unmatchedPolyspaceSuppression
1 parent 38051d1 commit 6003364

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

cli/cppcheckexecutor.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,11 @@ static bool reportUnmatchedSuppressions(const std::list<SuppressionList::Suppres
329329
if (!s.fileName.empty()) {
330330
callStack.emplace_back(s.fileName, s.lineNumber, 0);
331331
}
332-
errorLogger.reportErr(::ErrorMessage(std::move(callStack), "", Severity::information, "Unmatched suppression: " + s.errorId, "unmatchedSuppression", Certainty::normal));
332+
if (s.isPolyspace) {
333+
errorLogger.reportErr(::ErrorMessage(std::move(callStack), "", Severity::information, "Unmatched polyspace suppression: " + s.errorId, "unmatchedPolyspaceSuppression", Certainty::normal));
334+
} else {
335+
errorLogger.reportErr(::ErrorMessage(std::move(callStack), "", Severity::information, "Unmatched suppression: " + s.errorId, "unmatchedSuppression", Certainty::normal));
336+
}
333337
err = true;
334338
}
335339
return err;

lib/suppressions.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,7 @@ bool polyspace::Suppression::convert(const Settings &settings, SuppressionList::
895895

896896
suppr.errorId = prefix + resultName;
897897
suppr.isInline = true;
898+
suppr.isPolyspace = true;
898899
suppr.fileName = filename;
899900

900901
suppr.lineNumber = lineBegin;

lib/suppressions.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ class CPPCHECKLIB SuppressionList {
161161
bool matched{}; /** This suppression was fully matched in an isSuppressed() call */
162162
bool checked{}; /** This suppression applied to code which was being analyzed but did not match the error in an isSuppressed() call */
163163
bool isInline{};
164+
bool isPolyspace{};
164165

165166
enum : std::int8_t { NO_LINE = -1 };
166167
};

0 commit comments

Comments
 (0)