Added support for ftell() and puts() to std.cfg.
This commit is contained in:
parent
045e9e692b
commit
80e3b49cfc
10
cfg/std.cfg
10
cfg/std.cfg
|
@ -45,6 +45,16 @@
|
||||||
<arg nr="1"><not-null/><not-uninit/></arg>
|
<arg nr="1"><not-null/><not-uninit/></arg>
|
||||||
<arg nr="2"><not-null/><not-uninit/></arg>
|
<arg nr="2"><not-null/><not-uninit/></arg>
|
||||||
</function>
|
</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="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="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>
|
<function name="isblank"> <noreturn>false</noreturn> <leak-ignore/> <arg nr="1"><valid>0-255</valid></arg> </function>
|
||||||
|
|
|
@ -2411,6 +2411,12 @@ private:
|
||||||
check("void f(FILE *p){ ferror (p);if(!p){}}");
|
check("void f(FILE *p){ ferror (p);if(!p){}}");
|
||||||
ASSERT_EQUALS(errp,errout.str());
|
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){}}");
|
check("void f(char * p,char * q){ fopen (p,q);if(!p||!q){}}");
|
||||||
ASSERT_EQUALS(errpq,errout.str());
|
ASSERT_EQUALS(errpq,errout.str());
|
||||||
|
|
||||||
|
|
|
@ -3605,7 +3605,6 @@ private:
|
||||||
"}");
|
"}");
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
|
|
||||||
// fputs
|
// fputs
|
||||||
checkUninitVar("void f() {\n"
|
checkUninitVar("void f() {\n"
|
||||||
" char *c;\n"
|
" char *c;\n"
|
||||||
|
@ -3619,6 +3618,31 @@ private:
|
||||||
" fputs (c, f);\n"
|
" fputs (c, f);\n"
|
||||||
"}");
|
"}");
|
||||||
ASSERT_EQUALS("", errout.str());
|
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());
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue