Fix 14136: False positive: constParameterReference when using void cast#7829
Fix 14136: False positive: constParameterReference when using void cast#7829chrchr-github merged 2 commits intodanmar:mainfrom
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. |
I agree. And as you say it's also consistent with how we treat pointers. |



No description provided.