#7012: Fixed FP in std.cfg by explicitly definining the first parameter of snprintf.

This commit is contained in:
Martin Ettl 2015-09-29 21:33:39 +02:00
parent 69b1e21560
commit c64f9cf9b1
3 changed files with 14 additions and 4 deletions

View File

@ -3745,6 +3745,7 @@
<function name="snprintf,std::snprintf">
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1"/>
<arg nr="2">
<not-uninit/>
</arg>

View File

@ -3329,8 +3329,7 @@ void uninivar_snprintf(char *S, size_t N, char *Format, int Int)
// cppcheck-suppress uninitvar
(void)snprintf(S,N,Format,i); // i is uninitialized
// cppcheck-suppress redundantCopy
// cppcheck-suppress uninitvar
(void)snprintf(s,N,Format,Int); // no warning is expected for s (refer to #7012)
(void)snprintf(s,N,Format,Int);
}
void uninivar_vsnprintf(void)

View File

@ -2744,14 +2744,24 @@ void uninivar_fwprintf(void)
(void)std::fwprintf(stream,format,i);
}
void uninivar_snprintf(void)
void uninivar_snprintf(char *S, size_t N, char *Format, int Int)
{
char *s;
size_t n;
char *format;
int i;
char *s;
// cppcheck-suppress uninitvar
(void)std::snprintf(s,n,format,i);
// cppcheck-suppress uninitvar
(void)std::snprintf(S,n,Format,Int); // n is uninitialized
// cppcheck-suppress redundantCopy
// cppcheck-suppress uninitvar
(void)std::snprintf(S,N,format,Int); // format is uninitialized
// cppcheck-suppress redundantCopy
// cppcheck-suppress uninitvar
(void)std::snprintf(S,N,Format,i); // i is uninitialized
// cppcheck-suppress redundantCopy
(void)std::snprintf(s,N,Format,Int);
}
void uninivar_vsnprintf(void)