do not pass POD types by reference (based on clazy function-args-by-value check)#5388
do not pass POD types by reference (based on clazy function-args-by-value check)#5388danmar merged 2 commits intocppcheck-opensource:mainfrom
function-args-by-value check)#5388Conversation
|
I already filed https://trac.cppcheck.net/ticket/11880 about detecting this ourselves. |
7c4941e to
c4b9b7c
Compare
|
The |
|
how do we prevent that clazy is executed something like this perhaps? ? isn't it better that arguments are const, how does that hurt? |
No idea.
See #5388 (comment). |
|
I do not feel sure about removing constness from arguments. But at the same time I'm not sure if I would want to enforce constness everywhere neither. |
I would have kept it but then we should have cleaned up the headers to avoid potential confusion. But as these are POD types it should be clear but only if you have an IDE with hints (which is not a given). But as you see, we were not treating them as such.
Since it is just POD types there's no strings attached. Everything else is a whole can of worms which need proper tooling support which approaches it from multiple angles at once or you will end up with potentially suboptimal code you will never detect. |
No description provided.