std.cfg: Added <returnValue> information to isblank().

This commit is contained in:
orbitcowboy 2016-10-18 11:00:12 +02:00
parent 4587dfffd8
commit d5a145f288
2 changed files with 16 additions and 1 deletions

View File

@ -1531,6 +1531,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<pure/> <pure/>
<noreturn>false</noreturn> <noreturn>false</noreturn>
<leak-ignore/> <leak-ignore/>
<returnValue>arg1==' ' || arg1=='\t'</returnValue>
<arg nr="1"> <arg nr="1">
<not-uninit/> <not-uninit/>
<valid>0:255</valid> <valid>0:255</valid>

View File

@ -3692,7 +3692,7 @@ void valueFlow(void)
{ {
const char abc[] = "abc"; const char abc[] = "abc";
int three = 3, minusThree = -3; 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. // When adding functions below, please sort alphabetically.
@ -3703,7 +3703,21 @@ void valueFlow(void)
// cppcheck-suppress knownConditionTrueFalse // cppcheck-suppress knownConditionTrueFalse
AssertAlwaysTrue(abs(minusThree) == 3); AssertAlwaysTrue(abs(minusThree) == 3);
// cppcheck-suppress knownConditionTrueFalse // 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); AssertAlwaysTrue(isdigit(c0) == 1);
// cppcheck-suppress knownConditionTrueFalse // cppcheck-suppress knownConditionTrueFalse
AssertAlwaysTrue(isdigit(ca) == 0); 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);
} }