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

@ -45,16 +45,21 @@
<arg nr="1"><not-null/><not-uninit/></arg>
<arg nr="2"><not-null/><not-uninit/></arg>
</function>
<function name="ftell">
<noreturn>false</noreturn>
<leak-ignore/>
<function name="ftell">
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1"><not-null/><not-uninit/></arg>
</function>
<function name="puts">
<noreturn>false</noreturn>
<leak-ignore/>
</function>
<function name="puts">
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1"><not-null/><not-uninit/></arg>
</function>
</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());
}
};