Hello,
I am facing a warning in cppcheck (new in 2.8) I don't understand, with attached file.cpp I get:
new2.cpp:14:33: style: Condition 'std::min(apple,banana)!=-1' is always true [knownConditionTrueFalse] if (std::min(apple, banana) != -1) {
From my point of view, the case apple=-1 and banana=2 makes this a false positive, but maybe I missed something.
Thanks for helping me.
command line to reproduce the problem: cppcheck new2.cpp --enable=all
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/11124
Log in to post a comment.
Hello,
I am facing a warning in cppcheck (new in 2.8) I don't understand, with attached file.cpp I get:
new2.cpp:14:33: style: Condition 'std::min(apple,banana)!=-1' is always true [knownConditionTrueFalse]
if (std::min(apple, banana) != -1) {
From my point of view, the case apple=-1 and banana=2 makes this a false positive, but maybe I missed something.
Thanks for helping me.
command line to reproduce the problem: cppcheck new2.cpp --enable=all
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/11124