Skip to content

Commit c624e35

Browse files
committed
Add unmatchedPolyspaceSuppression
1 parent a6f1db9 commit c624e35

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
@@ -884,6 +884,7 @@ bool polyspace::Suppression::convert(SuppressionList::Suppression &suppr) const
884884

885885
suppr.errorId = it->second + resultName;
886886
suppr.isInline = true;
887+
suppr.isPolyspace = true;
887888
suppr.fileName = filename;
888889

889890
suppr.lineNumber = lineBegin;

lib/suppressions.h

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

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

0 commit comments

Comments
 (0)