Added support for putchar() to std.cfg.

This commit is contained in:
orbitcowboy 2014-03-20 05:49:38 +01:00
parent 430d6d398c
commit 6507824a34
3 changed files with 27 additions and 8 deletions

View File

@ -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>

View File

@ -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());

View File

@ -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());
}
};