Thanks, that worked
Here is an example I don't like cppcheck flagging with knownConditionTrueFalse
void SomeFunctionThatTakesABool(bool hasAttribute) { if(hasAttribute) { } } void ExampleFunction() { const bool hasIt = true; SomeFunctionThatTakesABool(!hasIt); }
We really may want to run the negative test at times. In the same function we may call it with the positive case too.
I often work around this by making a local non const and changing it's value but that is a waste.
This is maybe a related ticket: https://trac.cppcheck.net/ticket/9363
Thanks for pointing that out, I added a comment on it and support not flagging it.
Log in to post a comment.
Thanks, that worked
Here is an example I don't like cppcheck flagging with knownConditionTrueFalse
We really may want to run the negative test at times. In the same function we may call it with the positive case too.
I often work around this by making a local non const and changing it's value but that is a waste.
This is maybe a related ticket: https://trac.cppcheck.net/ticket/9363
Thanks for pointing that out, I added a comment on it and support not flagging it.