Version: 2.4.1 Example:
#include <stdlib.h> int main(int argc, char *argv[]) { int x = atoi(argv[1]); if(x) { if(x == 1) ; else ; } }
=>
/tmp/test.c:5:7: style: Condition 'x==1' is always true [knownConditionTrueFalse] if(x == 1) ^ /tmp/test.c:4:8: note: Assuming condition 'x' is true if(x) { ^ /tmp/test.c:5:7: note: Condition 'x==1' is always true if(x == 1)
Sry if this is already reported there are a lot of threads for knownConditionTrueFalse; i did not check all :)
Thanks! I can reproduce. I have created ticket https://trac.cppcheck.net/ticket/10323
This seems to be similar:
int func(const char *inp) { if(*inp) { if(*inp != '.') {} } }
Thanks! Yes it looks similar.
Log in to post a comment.
Version: 2.4.1
Example:
=>
Sry if this is already reported there are a lot of threads for knownConditionTrueFalse; i did not check all :)
Thanks! I can reproduce. I have created ticket https://trac.cppcheck.net/ticket/10323
This seems to be similar:
Thanks! Yes it looks similar.