-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Fix 14136: False positive: constParameterReference when using void cast #7829
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
Conversation
|
@chrchr-github @danmar @orbitcowboy Can this be merged? |
https://trac.cppcheck.net/ticket/13754 basically asks for the opposite of what this PR does, so we should be clear about how we handle |
That was about local variables. In both cases it is problematic for our "no configuration" approach because this heavily depends on coding guidelines (albeit unnamed parameters might also interfere with documentation generators). In some cases other tools might even behave different based on the annotation used (see #7810 (comment)). Given that we had incomplete handling of those in other places we should double-check them (not the scope of this - might take a look in a few days if nobody else does). |
We already skip warning when using the |
The important thing for me is to be consistent (which we usually are not) and to stay consistent (we flip-flop sometimes).
We should try not to add configuration. |
It does make it more consistent, even though that is not a stated goal for cppcheck. And it also reaches our stated goal of "If the code is written as it is by design, then our goal is to not show any false positives".
That is fine too, I guess I misunderstood your "it is problematic for our "no configuration" approach" comment. Either way, this fixes false positives on valid code and so it should be merged in. We can discuss how we want to solve the FNs for this case in the future. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks good to me.
I agree. And as you say it's also consistent with how we treat pointers. |
No description provided.