@@ -602,6 +602,10 @@ unsigned int CppCheck::check(const FileSettings &fs)
602602 const unsigned int returnValue = temp.checkFile (Path::simplifyPath (fs.filename ), fs.cfg );
603603 for (const auto & suppr : temp.mSettings .supprs .nomsg .getSuppressions ())
604604 {
605+ // skip inline suppressions - are handled in checkFile()
606+ if (suppr.isInline )
607+ continue ;
608+
605609 const bool res = mSettings .supprs .nomsg .updateSuppressionState (suppr);
606610 if (!res)
607611 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
947951 fdump << " </dump>" << std::endl;
948952 }
949953
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+ }
952958
953959 // Skip if we already met the same simplified token list
954960 if (mSettings .force || mSettings .maxConfigs > 1 ) {
@@ -1038,10 +1044,16 @@ unsigned int CppCheck::checkFile(const std::string& filename, const std::string
10381044 mAnalyzerInformation .close ();
10391045 }
10401046
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+ }
10451057 }
10461058
10471059 mErrorList .clear ();
0 commit comments