Skip to content

Commit bb28235

Browse files
committed
refs #14792 - flag included files as checked [skip ci]
1 parent 6fa5e8b commit bb28235

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

lib/cppcheck.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,6 +1227,21 @@ unsigned int CppCheck::checkInternal(const FileWithDetails& file, const std::str
12271227
mSuppressions.nomsg.markUnmatchedInlineSuppressionsAsChecked(tokenizer.list);
12281228
}
12291229

1230+
// TODO: handle differently?
1231+
// dummy call to make sure included files are being flagged as checked in case isSuppressed() is never called
1232+
for (auto f : tokenizer.list.getFiles())
1233+
{
1234+
f = Path::simplifyPath(f); // TODO: necessary?
1235+
1236+
// skip the file which is being analyzed
1237+
if (f == file.spath())
1238+
continue;
1239+
1240+
// the empty ID is intentional for now - although it should not be allowed
1241+
ErrorMessage msg({}, f, Severity::information, "", "", Certainty::normal);
1242+
(void)mSuppressions.nomsg.isSuppressed(SuppressionList::ErrorMessage::fromErrorMessage(msg, {}), true);
1243+
}
1244+
12301245
// Skip if we already met the same simplified token list
12311246
if (maxConfigs > 1) {
12321247
const std::size_t hash = tokenizer.list.calculateHash();

0 commit comments

Comments
 (0)