#6116 False positive uninitvar - first argument to wcstombs(). Correct stf.cfg

This commit is contained in:
Alexander Mai 2014-09-01 19:53:24 +02:00
parent a4ff30301a
commit f94e208862
2 changed files with 12 additions and 2 deletions

View File

@ -197,14 +197,12 @@
<function name="mbstowcs"> <function name="mbstowcs">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<leak-ignore/> <leak-ignore/>
<arg nr="1"><not-uninit/></arg>
<arg nr="2"><not-null/><not-uninit/></arg> <arg nr="2"><not-null/><not-uninit/></arg>
<arg nr="3"><not-uninit/></arg> <arg nr="3"><not-uninit/></arg>
</function> </function>
<function name="wcstombs"> <function name="wcstombs">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<leak-ignore/> <leak-ignore/>
<arg nr="1"><not-uninit/></arg>
<arg nr="2"><not-null/><not-uninit/></arg> <arg nr="2"><not-null/><not-uninit/></arg>
<arg nr="3"><not-uninit/></arg> <arg nr="3"><not-uninit/></arg>
</function> </function>

View File

@ -3711,6 +3711,18 @@ private:
" putchar (*c);\n" " putchar (*c);\n"
"}"); "}");
ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());
// #6116 False positive uninitvar - first argument to wcstombs()
checkUninitVar("void f( wchar_t *wstr) {\n"
" char buf[10];\n"
" wcstombs (buf, wstr, 3);\n"
"}");
ASSERT_EQUALS("", errout.str());
checkUninitVar("void f( char *str) {\n"
" wchar_t wbuf[10];\n"
" mbstowcs (wbuf, str, 3);\n"
"}");
ASSERT_EQUALS("", errout.str());
} }
void checkDeadPointer(const char code[]) { void checkDeadPointer(const char code[]) {