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/> <formatstr/>
<arg nr="2"> <arg nr="2">
<formatstr/> <formatstr/>
<not-uninit/>
</arg> </arg>
<arg nr="any"> <arg nr="any">
<not-uninit/> <not-uninit/>
@ -957,6 +958,7 @@
<formatstr/> <formatstr/>
<arg nr="2"> <arg nr="2">
<formatstr/> <formatstr/>
<not-uninit/>
</arg> </arg>
<arg nr="any"> <arg nr="any">
<not-uninit/> <not-uninit/>
@ -973,6 +975,7 @@
<formatstr/> <formatstr/>
<arg nr="2"> <arg nr="2">
<formatstr/> <formatstr/>
<not-uninit/>
</arg> </arg>
<arg nr="any"> <arg nr="any">
<not-uninit/> <not-uninit/>
@ -1103,7 +1106,7 @@
</arg> </arg>
</function> </function>
<!-- int fscanf(FILE *stream, const char *format, ...); --> <!-- int fscanf(FILE *stream, const char *format, ...); -->
<function name="fscanf"> <function name="fscanf,std::fscanf">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<leak-ignore/> <leak-ignore/>
<arg nr="1"> <arg nr="1">
@ -1112,6 +1115,7 @@
<formatstr scan="true"/> <formatstr scan="true"/>
<arg nr="2"> <arg nr="2">
<formatstr/> <formatstr/>
<not-uninit/>
</arg> </arg>
</function> </function>
<!-- int vfscanf(FILE *stream, const char * format, va_list arg); --> <!-- 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)vfprintf(stream, format, arg);
} }
void uninitar_vfwprintf(void) void uninitar_vfwprintf(FILE *s, wchar_t *f, va_list a)
{ {
FILE *stream; FILE *stream;
wchar_t *format; wchar_t *format;
@ -1262,6 +1262,12 @@ void uninitar_vfwprintf(void)
// cppcheck-suppress va_list_usedBeforeStarted // cppcheck-suppress va_list_usedBeforeStarted
// cppcheck-suppress uninitvar // cppcheck-suppress uninitvar
(void)vfwprintf(stream, format, arg); (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) void uninitvar_fputc(void)
@ -1357,6 +1363,15 @@ void uninitvar_hypot(void)
(void)hypotl(ld1,ld2); (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) void ignoreretrn(void)
{ {
char szNumbers[] = "2001 60c0c0 -1101110100110100100000 0x6fffff"; char szNumbers[] = "2001 60c0c0 -1101110100110100100000 0x6fffff";

View File

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