file test.c :
void main () { int i; do { i = random();
if( i == 0 ) continue; } while(i);
}
$ /opt/cppcheck-2.10/cppcheck --enable=all test.c Checking test.c ... test.c:10:13: style: Condition 'i' is always true [knownConditionTrueFalse] } while(i); ^
Is it a known issue ?
Thanks for reporting, it's probably an instance of https://trac.cppcheck.net/ticket/11096
ok, looks like it. but the example you just add to the trac ticket reports no false positive, but indeed a real [knownConditionTrueFalse]...
Thanks, fixed.
Log in to post a comment.
file test.c :
void main ()
{
int i;
do {
i = random();
}
$ /opt/cppcheck-2.10/cppcheck --enable=all test.c
Checking test.c ...
test.c:10:13: style: Condition 'i' is always true [knownConditionTrueFalse]
} while(i);
^
Is it a known issue ?
Thanks for reporting, it's probably an instance of https://trac.cppcheck.net/ticket/11096
ok, looks like it.
but the example you just add to the trac ticket reports no false positive, but indeed a real [knownConditionTrueFalse]...
Thanks, fixed.