Imroved std.cfg and added more test cases.

This commit is contained in:
Martin Ettl 2015-09-30 12:45:40 +02:00
parent 4fcd324ccd
commit 0b782853fe
3 changed files with 56 additions and 38 deletions

View File

@ -972,9 +972,7 @@
<formatstr/>
<not-uninit/>
</arg>
<arg nr="3">
<not-uninit/>
</arg>
<arg nr="3"/>
</function>
<!-- int vfwprintf(FILE *stream, const wchar_t *format, va_list arg); -->
<function name="vfwprintf,std::vfwprintf">
@ -989,9 +987,7 @@
<formatstr/>
<not-uninit/>
</arg>
<arg nr="3">
<not-uninit/>
</arg>
<arg nr="3"/>
</function>
<!-- int fputc(int c, FILE *stream); -->
<function name="fputc,std::fputc">
@ -2567,9 +2563,7 @@
<formatstr/>
<not-uninit/>
</arg>
<arg nr="2">
<not-uninit/>
</arg>
<arg nr="2"/>
</function>
<!-- int vwprintf(const wchar_t *format, va_list arg); -->
<function name="vwprintf,std::vwprintf">
@ -2580,9 +2574,7 @@
<formatstr/>
<not-uninit/>
</arg>
<arg nr="2">
<not-uninit/>
</arg>
<arg nr="2"/>
</function>
<!-- void* bsearch(const void* key, const void* base, size_t num, size_t size, int(*compar)(const void*,const void*));-->
<function name="bsearch,std::bsearch">
@ -3690,6 +3682,10 @@
<function name="swprintf,std::swprintf">
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
<minsize type="argvalue" arg="2"/>
<not-uninit/>
</arg>
<arg nr="2">
<not-uninit/>
</arg>
@ -3714,6 +3710,10 @@
<function name="vswprintf,std::vswprintf">
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
<minsize type="argvalue" arg="2"/>
<not-uninit/>
</arg>
<arg nr="2">
<not-uninit/>
</arg>
@ -3767,6 +3767,10 @@
<function name="vsnprintf,std::vsnprintf">
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
<not-uninit/>
<minsize type="argvalue" arg="2"/>
</arg>
<arg nr="2">
<not-uninit/>
</arg>

View File

@ -1292,12 +1292,11 @@ void uninitar_vfprintf(FILE *Stream, const char *Format, va_list Arg)
(void)vfprintf(stream, Format, Arg);
// cppcheck-suppress uninitvar
(void)vfprintf(Stream, format, Arg);
// cppcheck-suppress va_list_usedBeforeStarted
// cppcheck-suppress uninitvar
(void)vfprintf(Stream, Format, arg);
// no warning is expected
(void)vfprintf(Stream, Format, Arg);
// cppcheck-suppress va_list_usedBeforeStarted
(void)vfprintf(Stream, Format, arg);
}
void uninitar_vfwprintf(FILE *Stream, wchar_t *Format, va_list Arg)
@ -1312,12 +1311,11 @@ void uninitar_vfwprintf(FILE *Stream, wchar_t *Format, va_list Arg)
(void)vfwprintf(stream, Format, Arg);
// cppcheck-suppress uninitvar
(void)vfwprintf(Stream, format, Arg);
// cppcheck-suppress va_list_usedBeforeStarted
// cppcheck-suppress uninitvar
(void)vfwprintf(Stream, Format, arg);
// no warning is expected
(void)vfwprintf(Stream, Format, Arg);
// cppcheck-suppress va_list_usedBeforeStarted
(void)vfwprintf(Stream, Format, arg);
}
void uninitvar_fputc(void)
@ -2611,14 +2609,13 @@ void uninivar_vprintf(char *Format, va_list Arg)
// cppcheck-suppress va_list_usedBeforeStarted
// cppcheck-suppress uninitvar
(void)vprintf(format,arg);
// cppcheck-suppress va_list_usedBeforeStarted
// cppcheck-suppress uninitvar
(void)vprintf(Format,arg);
// cppcheck-suppress uninitvar
(void)vprintf(format,Arg);
// no warning is expected
(void)vprintf(Format,Arg);
// cppcheck-suppress va_list_usedBeforeStarted
(void)vprintf(Format,arg);
}
void uninivar_vwprintf(wchar_t *Format, va_list Arg)
@ -2628,14 +2625,13 @@ void uninivar_vwprintf(wchar_t *Format, va_list Arg)
// cppcheck-suppress va_list_usedBeforeStarted
// cppcheck-suppress uninitvar
(void)vwprintf(format,arg);
// cppcheck-suppress va_list_usedBeforeStarted
// cppcheck-suppress uninitvar
(void)vwprintf(Format,arg);
// cppcheck-suppress uninitvar
(void)vwprintf(format,Arg);
// no warning is expected
(void)vwprintf(Format,Arg);
// cppcheck-suppress va_list_usedBeforeStarted
(void)vwprintf(Format,arg);
}
void uninivar_bsearch(void)
@ -3396,7 +3392,7 @@ void uninivar_snprintf(char *S, size_t N, char *Format, int Int)
(void)snprintf(S,N,Format,Int);
}
void uninivar_vsnprintf(void)
void uninivar_vsnprintf(char *S, size_t N, char *Format, va_list Arg)
{
char *s;
size_t n;
@ -3405,6 +3401,17 @@ void uninivar_vsnprintf(void)
// cppcheck-suppress va_list_usedBeforeStarted
// cppcheck-suppress uninitvar
(void)vsnprintf(s,n,format,arg);
// cppcheck-suppress uninitvar
(void)vsnprintf(s,N,Format,Arg);
// cppcheck-suppress uninitvar
(void)vsnprintf(S,n,Format,Arg);
// cppcheck-suppress uninitvar
(void)vsnprintf(S,N,format,Arg);
// no warning is expected for
(void)vsnprintf(S,N,Format,Arg);
// cppcheck-suppress va_list_usedBeforeStarted
(void)vsnprintf(S,N,Format,arg);
}
void uninivar_wscanf(void)

View File

@ -821,12 +821,11 @@ void uninitar_vfprintf(FILE *Stream, const char *Format, va_list Arg)
(void)std::vfprintf(stream, Format, Arg);
// cppcheck-suppress uninitvar
(void)std::vfprintf(Stream, format, Arg);
// cppcheck-suppress va_list_usedBeforeStarted
// cppcheck-suppress uninitvar
(void)std::vfprintf(Stream, Format, arg);
// no warning is expected
(void)std::vfprintf(Stream, Format, Arg);
// cppcheck-suppress va_list_usedBeforeStarted
(void)std::vfprintf(Stream, Format, arg);
}
void uninitar_vfwprintf(FILE *Stream, wchar_t *Format, va_list Arg)
@ -841,12 +840,11 @@ void uninitar_vfwprintf(FILE *Stream, wchar_t *Format, va_list Arg)
(void)std::vfwprintf(stream, Format, Arg);
// cppcheck-suppress uninitvar
(void)std::vfwprintf(Stream, format, Arg);
// cppcheck-suppress va_list_usedBeforeStarted
// cppcheck-suppress uninitvar
(void)std::vfwprintf(Stream, Format, arg);
// no warning is expected
(void)std::vfwprintf(Stream, Format, Arg);
// cppcheck-suppress va_list_usedBeforeStarted
(void)std::vfwprintf(Stream, Format, arg);
}
void uninitvar_fputc(void)
@ -1945,14 +1943,13 @@ void uninivar_vprintf(char *Format, va_list Arg)
// cppcheck-suppress va_list_usedBeforeStarted
// cppcheck-suppress uninitvar
(void)std::vprintf(format,arg);
// cppcheck-suppress va_list_usedBeforeStarted
// cppcheck-suppress uninitvar
(void)std::vprintf(Format,arg);
// cppcheck-suppress uninitvar
(void)std::vprintf(format,Arg);
// no warning is expected
(void)std::vprintf(Format,Arg);
// cppcheck-suppress va_list_usedBeforeStarted
(void)std::vprintf(Format,arg);
}
void uninivar_vwprintf(wchar_t *Format, va_list Arg)
@ -1962,14 +1959,13 @@ void uninivar_vwprintf(wchar_t *Format, va_list Arg)
// cppcheck-suppress va_list_usedBeforeStarted
// cppcheck-suppress uninitvar
(void)std::vwprintf(format,arg);
// cppcheck-suppress va_list_usedBeforeStarted
// cppcheck-suppress uninitvar
(void)std::vwprintf(Format,arg);
// cppcheck-suppress uninitvar
(void)std::vwprintf(format,Arg);
// no warning is expected
(void)std::vwprintf(Format,Arg);
// cppcheck-suppress va_list_usedBeforeStarted
(void)std::vwprintf(Format,arg);
}
void uninivar_bsearch(void)
@ -2821,7 +2817,7 @@ void uninivar_snprintf(char *S, size_t N, char *Format, int Int)
(void)std::snprintf(S,N,Format,Int);
}
void uninivar_vsnprintf(void)
void uninivar_vsnprintf(char *S, size_t N, char *Format, va_list Arg)
{
char *s;
size_t n;
@ -2830,6 +2826,17 @@ void uninivar_vsnprintf(void)
// cppcheck-suppress va_list_usedBeforeStarted
// cppcheck-suppress uninitvar
(void)std::vsnprintf(s,n,format,arg);
// cppcheck-suppress uninitvar
(void)std::vsnprintf(s,N,Format,Arg);
// cppcheck-suppress uninitvar
(void)std::vsnprintf(S,n,Format,Arg);
// cppcheck-suppress uninitvar
(void)std::vsnprintf(S,N,format,Arg);
// no warning is expected for
(void)std::vsnprintf(S,N,Format,Arg);
// cppcheck-suppress va_list_usedBeforeStarted
(void)std::vsnprintf(S,N,Format,arg);
}
void uninivar_wscanf(void)