Skip to content
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

Implemented suppressing warnings using error message text #1302

Closed
wants to merge 4 commits into from
Closed

Implemented suppressing warnings using error message text #1302

wants to merge 4 commits into from

Conversation

rebnridgway
Copy link
Contributor

I encountered a situation where I wanted to suppress a warning that was being emitted by an assert macro:
"knownConditionTrueFalse: Condition '!true' is always false"

Because this warning has no symbol and comes from many locations, there was no other way to suppress it than by introducing this functionality.

This is to add support for suppressing a warning using the text of its warning message, plus wildcards.  This is useful for suppressing warnings like knownConditionTrueFalse (which has no symbol) when they are emitted for code within a macro.  There is no other way of doing a specific suppression for this.
@amai2012
Copy link
Collaborator

Do you face a situation similar to https://trac.cppcheck.net/ticket/3537?

@pfultz2
Copy link
Contributor

pfultz2 commented Jul 11, 2018

We should probably skip the error when a literal is used. Thats what I did for PR #1294.

@rebnridgway
Copy link
Contributor Author

@amai2012 Similar, yes. Fixing that ticket would make this PR unnecessary. I looked at doing something like that, but this seemed like an easier fix.

@pfultz2 That would also solve my problem :)

@amai2012
Copy link
Collaborator

@amai2012 Similar, yes. Fixing that ticket would make this PR unnecessary. I looked at doing something like that, but this seemed like an easier fix.

I'd prefer the other solution, though...

@pfultz2
Copy link
Contributor

pfultz2 commented Jul 11, 2018

So PR #1304 should fix the FP with knownConditionTrueFalse when the condition is a literal.

@amai2012 amai2012 requested a review from danmar July 11, 2018 16:35
@danmar
Copy link
Owner

danmar commented Jul 13, 2018

I close this PR. Fixing the FP is prefered.

@danmar danmar closed this Jul 13, 2018
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.

4 participants