@@ -602,6 +602,10 @@ unsigned int CppCheck::check(const FileSettings &fs)
602
602
const unsigned int returnValue = temp.checkFile (Path::simplifyPath (fs.filename ), fs.cfg );
603
603
for (const auto & suppr : temp.mSettings .supprs .nomsg .getSuppressions ())
604
604
{
605
+ // skip inline suppressions - are handled in checkFile()
606
+ if (suppr.isInline )
607
+ continue ;
608
+
605
609
const bool res = mSettings .supprs .nomsg .updateSuppressionState (suppr);
606
610
if (!res)
607
611
throw InternalError (nullptr , " could not update suppression '" + suppr.errorId + " '" ); // TODO: remove
@@ -947,8 +951,10 @@ unsigned int CppCheck::checkFile(const std::string& filename, const std::string
947
951
fdump << " </dump>" << std::endl;
948
952
}
949
953
950
- // Need to call this even if the hash will skip this configuration
951
- mSettings .supprs .nomsg .markUnmatchedInlineSuppressionsAsChecked (tokenizer);
954
+ if (mSettings .inlineSuppressions ) {
955
+ // Need to call this even if the hash will skip this configuration
956
+ mSettings .supprs .nomsg .markUnmatchedInlineSuppressionsAsChecked (tokenizer);
957
+ }
952
958
953
959
// Skip if we already met the same simplified token list
954
960
if (mSettings .force || mSettings .maxConfigs > 1 ) {
@@ -1038,10 +1044,16 @@ unsigned int CppCheck::checkFile(const std::string& filename, const std::string
1038
1044
mAnalyzerInformation .close ();
1039
1045
}
1040
1046
1041
- // In jointSuppressionReport mode, unmatched suppressions are
1042
- // collected after all files are processed
1043
- if (!mSettings .useSingleJob () && (mSettings .severity .isEnabled (Severity::information) || mSettings .checkConfiguration )) {
1044
- SuppressionList::reportUnmatchedSuppressions (mSettings .supprs .nomsg .getUnmatchedLocalSuppressions (filename, (bool )mUnusedFunctionsCheck ), *this );
1047
+ if (mSettings .severity .isEnabled (Severity::information) || mSettings .checkConfiguration ) {
1048
+ // TODO: check result?
1049
+ SuppressionList::reportUnmatchedSuppressions (mSettings .supprs .nomsg .getUnmatchedInlineSuppressions (false ), *this );
1050
+
1051
+ // In jointSuppressionReport mode, unmatched suppressions are
1052
+ // collected after all files are processed
1053
+ if (!mSettings .useSingleJob ()) {
1054
+ // TODO: check result?
1055
+ SuppressionList::reportUnmatchedSuppressions (mSettings .supprs .nomsg .getUnmatchedLocalSuppressions (filename, (bool )mUnusedFunctionsCheck ), *this );
1056
+ }
1045
1057
}
1046
1058
1047
1059
mErrorList .clear ();
0 commit comments