test/cfg: Improved testing of std.cfg regarding uninitialized variables.

This commit is contained in:
orbitcowboy 2015-09-08 16:08:43 +02:00
parent 60770a8fdc
commit e929e9e7d9
3 changed files with 79 additions and 5 deletions

View File

@ -3447,10 +3447,12 @@
</arg>
</function>
<!-- char *tmpnam(char *s); -->
<function name="tmpnam">
<function name="tmpnam,std::tmpnam">
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1"/>
<arg nr="1">
<not-uninit/>
</arg>
</function>
<!-- FILE *tmpfile(void); -->
<function name="tmpfile">
@ -3458,35 +3460,41 @@
<noreturn>false</noreturn>
</function>
<!-- int tolower(int c); -->
<function name="tolower">
<function name="tolower,std::tolower">
<use-retval/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
<not-uninit/>
<valid>0:255</valid>
</arg>
</function>
<!-- int toupper(int c); -->
<function name="toupper">
<function name="toupper,std::toupper">
<use-retval/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
<not-uninit/>
<valid>0:255</valid>
</arg>
</function>
<!-- type va_arg(va_list ap, type); -->
<function name="va_arg">
<noreturn>false</noreturn>
<leak-ignore/>
</function>
<!-- void va_copy(va_list dest, va_list src); -->
<function name="va_copy">
<noreturn>false</noreturn>
<leak-ignore/>
</function>
<!-- void va_end(va_list ap); -->
<function name="va_end">
<noreturn>false</noreturn>
<leak-ignore/>
</function>
<!-- void va_start(va_list ap, paramN); -->
<function name="va_start">
<noreturn>false</noreturn>
<leak-ignore/>
@ -3494,7 +3502,7 @@
<!-- float wcstof(const wchar_t *s, wchar ** endp); -->
<!-- double wcstod(const wchar_t *s, wchar ** endp); -->
<!-- long double wcstold(const wchar_t *s, wchar ** endp); -->
<function name="wcstof,wcstod,wcstold">
<function name="wcstof,std::wcstof,wcstod,std::wcstod,wcstold,std::wcstold">
<use-retval/>
<noreturn>false</noreturn>
<leak-ignore/>

View File

@ -3136,3 +3136,36 @@ void uninitvar_time(void)
// cppcheck-suppress uninitvar
(void)time(tp);
}
void uninitvar_tmpnam(void)
{
char *s;
// cppcheck-suppress uninitvar
(void)tmpnam(s);
}
void uninivar_tolower(void)
{
int c;
// cppcheck-suppress uninitvar
(void)tolower(c);
}
void uninivar_toupper(void)
{
int c;
// cppcheck-suppress uninitvar
(void)toupper(c);
}
void uninivar_wcstof(void)
{
const wchar_t *s;
wchar_t **endp;
// cppcheck-suppress uninitvar
(void)wcstof(s,endp);
// cppcheck-suppress uninitvar
(void)wcstod(s,endp);
// cppcheck-suppress uninitvar
(void)wcstold(s,endp);
}

View File

@ -2446,3 +2446,36 @@ void uninitvar_time(void)
// cppcheck-suppress uninitvar
(void)std::time(tp);
}
void uninitvar_tmpnam(void)
{
char *s;
// cppcheck-suppress uninitvar
(void)std::tmpnam(s);
}
void uninivar_tolower(void)
{
int c;
// cppcheck-suppress uninitvar
(void)std::tolower(c);
}
void uninivar_toupper(void)
{
int c;
// cppcheck-suppress uninitvar
(void)std::toupper(c);
}
void uninivar_wcstof(void)
{
const wchar_t *s;
wchar_t **endp;
// cppcheck-suppress uninitvar
(void)std::wcstof(s,endp);
// cppcheck-suppress uninitvar
(void)std::wcstod(s,endp);
// cppcheck-suppress uninitvar
(void)std::wcstold(s,endp);
}