Improved testing of std.cfg.

This commit is contained in:
orbitcowboy 2015-08-31 17:10:10 +02:00
parent dc6c278d83
commit f24fdb4257
3 changed files with 30 additions and 2 deletions

View File

@ -941,6 +941,7 @@
<formatstr/>
<arg nr="2">
<formatstr/>
<not-uninit/>
</arg>
<arg nr="any">
<not-uninit/>
@ -957,6 +958,7 @@
<formatstr/>
<arg nr="2">
<formatstr/>
<not-uninit/>
</arg>
<arg nr="any">
<not-uninit/>
@ -973,6 +975,7 @@
<formatstr/>
<arg nr="2">
<formatstr/>
<not-uninit/>
</arg>
<arg nr="any">
<not-uninit/>
@ -1103,7 +1106,7 @@
</arg>
</function>
<!-- int fscanf(FILE *stream, const char *format, ...); -->
<function name="fscanf">
<function name="fscanf,std::fscanf">
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
@ -1112,6 +1115,7 @@
<formatstr scan="true"/>
<arg nr="2">
<formatstr/>
<not-uninit/>
</arg>
</function>
<!-- int vfscanf(FILE *stream, const char * format, va_list arg); -->

View File

@ -1254,7 +1254,7 @@ void uninitar_vfprintf(void)
(void)vfprintf(stream, format, arg);
}
void uninitar_vfwprintf(void)
void uninitar_vfwprintf(FILE *s, wchar_t *f, va_list a)
{
FILE *stream;
wchar_t *format;
@ -1262,6 +1262,12 @@ void uninitar_vfwprintf(void)
// cppcheck-suppress va_list_usedBeforeStarted
// cppcheck-suppress uninitvar
(void)vfwprintf(stream, format, arg);
// cppcheck-suppress uninitvar
(void)vfwprintf(s, format, a);
// cppcheck-suppress uninitvar
(void)vfwprintf(stream, f, a);
// no warning is expected
(void)vfwprintf(s, f, a);
}
void uninitvar_fputc(void)
@ -1357,6 +1363,15 @@ void uninitvar_hypot(void)
(void)hypotl(ld1,ld2);
}
void uninitvar_fscanf(void)
{
FILE *stream;
char *format;
int i;
// cppcheck-suppress uninitvar
(void)fscanf(stream,format,i);
}
void ignoreretrn(void)
{
char szNumbers[] = "2001 60c0c0 -1101110100110100100000 0x6fffff";

View File

@ -879,3 +879,12 @@ void uninitvar_hypot(void)
// cppcheck-suppress uninitvar
(void)std::hypot(ld1,ld2);
}
void uninitvar_fscanf(void)
{
FILE *stream;
char *format;
int i;
// cppcheck-suppress uninitvar
(void)std::fscanf(stream,format,i);
}