Added support for ftell() and puts() to std.cfg.

This commit is contained in:
orbitcowboy 2014-03-20 04:10:41 +01:00
parent 045e9e692b
commit 80e3b49cfc
3 changed files with 41 additions and 1 deletions

View File

@ -45,6 +45,16 @@
<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/>
<arg nr="1"><not-null/><not-uninit/></arg>
</function>
<function name="puts">
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1"><not-null/><not-uninit/></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

@ -2411,6 +2411,12 @@ private:
check("void f(FILE *p){ ferror (p);if(!p){}}");
ASSERT_EQUALS(errp,errout.str());
check("void f(FILE *p){ ftell (p);if(!p){}}");
ASSERT_EQUALS(errp,errout.str());
check("void f(char *p){ puts (p);if(!p){}}");
ASSERT_EQUALS(errp,errout.str());
check("void f(char * p,char * q){ fopen (p,q);if(!p||!q){}}");
ASSERT_EQUALS(errpq,errout.str());

View File

@ -3605,7 +3605,6 @@ private:
"}");
ASSERT_EQUALS("", errout.str());
// fputs
checkUninitVar("void f() {\n"
" char *c;\n"
@ -3619,6 +3618,31 @@ private:
" fputs (c, f);\n"
"}");
ASSERT_EQUALS("", errout.str());
// ftell
checkUninitVar("void f() {\n"
" FILE *f;"
" ftell (f);\n"
"}");
ASSERT_EQUALS("[test.cpp:2]: (error) Uninitialized variable: f\n", errout.str());
checkUninitVar("void f( FILE *f) {\n"
" ftell (f);\n"
"}");
ASSERT_EQUALS("", errout.str());
// puts
checkUninitVar("void f() {\n"
" char *c;"
" puts (c);\n"
"}");
ASSERT_EQUALS("[test.cpp:2]: (error) Uninitialized variable: c\n", errout.str());
checkUninitVar("void f( char *c) {\n"
" puts (c);\n"
"}");
ASSERT_EQUALS("", errout.str());
}
};