style/knownConditionTrueFalse: The comparison '0 == first' is always true.
style/knownConditionTrueFalse: The comparison '0 == second' is always true.
style/knownConditionTrueFalse: The comparison '0 == first' is always true.
style/knownConditionTrueFalse: The comparison '0 == second' is always true.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
well.. I can reproduce.. but I am not sure about the programming style to use const for a parameter and then write to its data.
When I remove the const then the knownConditionTrueFalse is fixed. However I get a constParameter instead. Imho that is a false positive that should not be written.
Cppcheck-2.1
Result
style/knownConditionTrueFalse: The comparison '0 == first' is always true.
style/knownConditionTrueFalse: The comparison '0 == second' is always true.
style/knownConditionTrueFalse: The comparison '0 == first' is always true.
style/knownConditionTrueFalse: The comparison '0 == second' is always true.
well.. I can reproduce.. but I am not sure about the programming style to use
const
for a parameter and then write to its data.When I remove the
const
then theknownConditionTrueFalse
is fixed. However I get aconstParameter
instead. Imho that is a false positive that should not be written.I created ticket https://trac.cppcheck.net/ticket/9927