Improved testing of std.cfg and added more test cases.
This commit is contained in:
parent
baced8c9d8
commit
f653189bd4
16
cfg/std.cfg
16
cfg/std.cfg
|
@ -917,7 +917,7 @@
|
|||
</arg>
|
||||
</function>
|
||||
<!-- FILE * fopen(const char *filename, const char* mode); -->
|
||||
<function name="fopen">
|
||||
<function name="fopen,std::fopen">
|
||||
<use-retval/>
|
||||
<noreturn>false</noreturn>
|
||||
<arg nr="1">
|
||||
|
@ -931,7 +931,7 @@
|
|||
</arg>
|
||||
</function>
|
||||
<!-- int fprintf(FILE *stream, const char *format, ...); -->
|
||||
<function name="fprintf">
|
||||
<function name="fprintf,std::fprintf">
|
||||
<noreturn>false</noreturn>
|
||||
<leak-ignore/>
|
||||
<arg nr="1">
|
||||
|
@ -947,7 +947,7 @@
|
|||
</arg>
|
||||
</function>
|
||||
<!-- int vfprintf(FILE *stream, const char *format, va_list arg); -->
|
||||
<function name="vfprintf">
|
||||
<function name="vfprintf,std::vfprintf">
|
||||
<noreturn>false</noreturn>
|
||||
<leak-ignore/>
|
||||
<arg nr="1">
|
||||
|
@ -963,7 +963,7 @@
|
|||
</arg>
|
||||
</function>
|
||||
<!-- int vfwprintf(FILE *stream, const wchar_t *format, va_list arg); -->
|
||||
<function name="vfwprintf">
|
||||
<function name="vfwprintf,std::vfwprintf">
|
||||
<noreturn>false</noreturn>
|
||||
<leak-ignore/>
|
||||
<arg nr="1">
|
||||
|
@ -979,7 +979,7 @@
|
|||
</arg>
|
||||
</function>
|
||||
<!-- int fputc(int c, FILE *stream); -->
|
||||
<function name="fputc">
|
||||
<function name="fputc,std::fputc">
|
||||
<noreturn>false</noreturn>
|
||||
<leak-ignore/>
|
||||
<arg nr="1">
|
||||
|
@ -993,7 +993,7 @@
|
|||
</arg>
|
||||
</function>
|
||||
<!-- wint_t fputwc(wchar_t wc, FILE * stream); -->
|
||||
<function name="fputwc">
|
||||
<function name="fputwc,std::fputwc">
|
||||
<noreturn>false</noreturn>
|
||||
<leak-ignore/>
|
||||
<arg nr="1">
|
||||
|
@ -1006,7 +1006,7 @@
|
|||
</arg>
|
||||
</function>
|
||||
<!-- int fputs(const char *string, FILE* stream); -->
|
||||
<function name="fputs">
|
||||
<function name="fputs,std::fputs">
|
||||
<noreturn>false</noreturn>
|
||||
<leak-ignore/>
|
||||
<arg nr="1">
|
||||
|
@ -1020,7 +1020,7 @@
|
|||
</arg>
|
||||
</function>
|
||||
<!-- int fputws(const wchar_t* ws, FILE* stream); -->
|
||||
<function name="fputws">
|
||||
<function name="fputws,std::fputws">
|
||||
<noreturn>false</noreturn>
|
||||
<leak-ignore/>
|
||||
<arg nr="1">
|
||||
|
|
|
@ -1226,6 +1226,76 @@ void uninitvar_fmod(void)
|
|||
(void)fmodl(ld1,ld2);
|
||||
}
|
||||
|
||||
void uninitar_fopen(void)
|
||||
{
|
||||
char *filename;
|
||||
char *mode;
|
||||
// cppcheck-suppress uninitvar
|
||||
FILE * fp = fopen(filename, mode);
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
void uninitar_fprintf(void)
|
||||
{
|
||||
FILE *stream;
|
||||
char *format;
|
||||
int argument;
|
||||
// cppcheck-suppress uninitvar
|
||||
(void)fprintf(stream, format, argument);
|
||||
}
|
||||
|
||||
void uninitar_vfprintf(void)
|
||||
{
|
||||
FILE *stream;
|
||||
char *format;
|
||||
va_list arg;
|
||||
// cppcheck-suppress va_list_usedBeforeStarted
|
||||
// cppcheck-suppress uninitvar
|
||||
(void)vfprintf(stream, format, arg);
|
||||
}
|
||||
|
||||
void uninitar_vfwprintf(void)
|
||||
{
|
||||
FILE *stream;
|
||||
wchar_t *format;
|
||||
va_list arg;
|
||||
// cppcheck-suppress va_list_usedBeforeStarted
|
||||
// cppcheck-suppress uninitvar
|
||||
(void)vfwprintf(stream, format, arg);
|
||||
}
|
||||
|
||||
void uninitvar_fputc(void)
|
||||
{
|
||||
int c;
|
||||
FILE *stream;
|
||||
// cppcheck-suppress uninitvar
|
||||
(void)fputc(c,stream);
|
||||
}
|
||||
|
||||
void uninitvar_fputwc(void)
|
||||
{
|
||||
wchar_t c;
|
||||
FILE *stream;
|
||||
// cppcheck-suppress uninitvar
|
||||
(void)fputwc(c,stream);
|
||||
}
|
||||
|
||||
void uninitvar_fputs(void)
|
||||
{
|
||||
char *string;
|
||||
FILE *stream;
|
||||
// cppcheck-suppress uninitvar
|
||||
(void)fputs(string,stream);
|
||||
}
|
||||
|
||||
void uninitvar_fputws(void)
|
||||
{
|
||||
wchar_t *string;
|
||||
FILE *stream;
|
||||
// cppcheck-suppress uninitvar
|
||||
(void)fputws(string,stream);
|
||||
}
|
||||
|
||||
void ignoreretrn(void)
|
||||
{
|
||||
char szNumbers[] = "2001 60c0c0 -1101110100110100100000 0x6fffff";
|
||||
|
|
|
@ -748,3 +748,73 @@ void uninitvar_fmod(void)
|
|||
// cppcheck-suppress uninitvar
|
||||
(void)std::fmod(ld1,ld2);
|
||||
}
|
||||
|
||||
void uninitar_fopen(void)
|
||||
{
|
||||
char *filename;
|
||||
char *mode;
|
||||
// cppcheck-suppress uninitvar
|
||||
FILE * fp = std::fopen(filename, mode);
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
void uninitar_fprintf(void)
|
||||
{
|
||||
FILE *stream;
|
||||
char *format;
|
||||
int argument;
|
||||
// cppcheck-suppress uninitvar
|
||||
(void)std::fprintf(stream, format, argument);
|
||||
}
|
||||
|
||||
void uninitar_vfprintf(void)
|
||||
{
|
||||
FILE *stream;
|
||||
char *format;
|
||||
va_list arg;
|
||||
// cppcheck-suppress va_list_usedBeforeStarted
|
||||
// cppcheck-suppress uninitvar
|
||||
(void)std::vfprintf(stream, format, arg);
|
||||
}
|
||||
|
||||
void uninitar_vfwprintf(void)
|
||||
{
|
||||
FILE *stream;
|
||||
wchar_t *format;
|
||||
va_list arg;
|
||||
// cppcheck-suppress va_list_usedBeforeStarted
|
||||
// cppcheck-suppress uninitvar
|
||||
(void)std::vfwprintf(stream, format, arg);
|
||||
}
|
||||
|
||||
void uninitvar_fputc(void)
|
||||
{
|
||||
int c;
|
||||
FILE *stream;
|
||||
// cppcheck-suppress uninitvar
|
||||
(void)std::fputc(c,stream);
|
||||
}
|
||||
|
||||
void uninitvar_fputwc(void)
|
||||
{
|
||||
wchar_t c;
|
||||
FILE *stream;
|
||||
// cppcheck-suppress uninitvar
|
||||
(void)std::fputwc(c,stream);
|
||||
}
|
||||
|
||||
void uninitvar_fputs(void)
|
||||
{
|
||||
char *string;
|
||||
FILE *stream;
|
||||
// cppcheck-suppress uninitvar
|
||||
(void)std::fputs(string,stream);
|
||||
}
|
||||
|
||||
void uninitvar_fputws(void)
|
||||
{
|
||||
wchar_t *string;
|
||||
FILE *stream;
|
||||
// cppcheck-suppress uninitvar
|
||||
(void)std::fputws(string,stream);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue