diff --git a/cfg/std.cfg b/cfg/std.cfg index 56831ad1d..047894a4f 100644 --- a/cfg/std.cfg +++ b/cfg/std.cfg @@ -1531,6 +1531,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun false + arg1==' ' || arg1=='\t' 0:255 diff --git a/test/cfg/std.c b/test/cfg/std.c index b3cde936a..f01c4afc0 100644 --- a/test/cfg/std.c +++ b/test/cfg/std.c @@ -3692,7 +3692,7 @@ void valueFlow(void) { const char abc[] = "abc"; int three = 3, minusThree = -3; - int c0='0', ca='a'; + int c0='0', ca='a', blank=' ', tab='\t'; // When adding functions below, please sort alphabetically. @@ -3703,7 +3703,21 @@ void valueFlow(void) // cppcheck-suppress knownConditionTrueFalse AssertAlwaysTrue(abs(minusThree) == 3); // cppcheck-suppress knownConditionTrueFalse + AssertAlwaysTrue(isblank(blank) == 1); + // cppcheck-suppress knownConditionTrueFalse + AssertAlwaysTrue(isblank(tab) == 1); + // cppcheck-suppress knownConditionTrueFalse + AssertAlwaysTrue(isblank(c0) == 0); + // cppcheck-suppress knownConditionTrueFalse AssertAlwaysTrue(isdigit(c0) == 1); // cppcheck-suppress knownConditionTrueFalse AssertAlwaysTrue(isdigit(ca) == 0); + // cppcheck-suppress knownConditionTrueFalse + AssertAlwaysTrue(labs(three) == 3); + // cppcheck-suppress knownConditionTrueFalse + AssertAlwaysTrue(labs(minusThree) == 3); + // cppcheck-suppress knownConditionTrueFalse + AssertAlwaysTrue(llabs(three) == 3); + // cppcheck-suppress knownConditionTrueFalse + AssertAlwaysTrue(llabs(minusThree) == 3); }