Skip to content

Fix #14064 Files are reanalyzed with --cppcheck-build-dir and inline suppressions (regression) #7741

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

chrchr-github
Copy link
Collaborator

No description provided.

{
std::lock_guard<std::mutex> lg(mSuppressionsSync);

out << " <suppressions>" << std::endl;
for (const Suppression &suppression : mSuppressions) {
if (!filePath.empty() && !suppression.fileName.empty() && filePath != suppression.fileName)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the suppression could contain a pattern we need to use the matching logic of the suppressions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I follow. There is only one suppression at a time, and we only care about inline suppressions.

@firewave
Copy link
Collaborator

Way to test the non-inline suppression case:

  • create two input files
  • analyze with builddir
  • provide --suppress CLI option which only matches one of the files
  • re-analyze
  • make sure only the matching file has a different hash

@firewave
Copy link
Collaborator

It is possible that unmatchedSuppression warnings could somehow be leveraged to test this - but since those are still partially broken that is not really an option.

@chrchr-github chrchr-github marked this pull request as ready for review August 15, 2025 06:57
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants