Added support for putchar() to std.cfg.
This commit is contained in:
parent
430d6d398c
commit
6507824a34
|
@ -55,6 +55,11 @@
|
|||
<leak-ignore/>
|
||||
<arg nr="1"><not-null/><not-uninit/></arg>
|
||||
</function>
|
||||
<function name="putchar">
|
||||
<noreturn>false</noreturn>
|
||||
<leak-ignore/>
|
||||
<arg nr="1"><not-null/><not-uninit/><not-bool/><valid>0-</valid></arg>
|
||||
</function>
|
||||
<function name="isalnum"> <noreturn>false</noreturn> <leak-ignore/> <arg nr="1"><valid>0-255</valid></arg> </function>
|
||||
<function name="isalpha"> <noreturn>false</noreturn> <leak-ignore/> <arg nr="1"><valid>0-255</valid></arg> </function>
|
||||
<function name="isblank"> <noreturn>false</noreturn> <leak-ignore/> <arg nr="1"><valid>0-255</valid></arg> </function>
|
||||
|
|
|
@ -2435,6 +2435,9 @@ private:
|
|||
check("void f(char * p){ strchr (p,c);if(!p){}}");
|
||||
ASSERT_EQUALS(errp,errout.str());
|
||||
|
||||
check("void f(char * p){ putchar (*p);if(!p){}}");
|
||||
ASSERT_EQUALS(errp,errout.str());
|
||||
|
||||
check("void f(char * p){ strdup (p);if(!p){}}");
|
||||
ASSERT_EQUALS(errp,errout.str());
|
||||
|
||||
|
|
|
@ -3643,6 +3643,17 @@ private:
|
|||
"}");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
// putchar
|
||||
checkUninitVar("void f() {\n"
|
||||
" char *c;"
|
||||
" putchar (*c);\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("[test.cpp:2]: (error) Uninitialized variable: c\n", errout.str());
|
||||
|
||||
checkUninitVar("void f( char *c) {\n"
|
||||
" putchar (*c);\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue