Improved testing of std.cfg and added more test cases for snprintf(). There is a FP (according to #7012).

This commit is contained in:
Martin Ettl 2015-09-29 21:14:22 +02:00
parent ba2671e19a
commit 69b1e21560
1 changed files with 13 additions and 2 deletions

View File

@ -3312,14 +3312,25 @@ void uninivar_fwprintf(void)
(void)fwprintf(stream,format,i); (void)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; size_t n;
char *format; char *format;
int i; int i;
char *s;
// cppcheck-suppress uninitvar // cppcheck-suppress uninitvar
(void)snprintf(s,n,format,i); (void)snprintf(s,n,format,i);
// cppcheck-suppress uninitvar
(void)snprintf(S,n,Format,Int); // n is uninitialized
// cppcheck-suppress redundantCopy
// cppcheck-suppress uninitvar
(void)snprintf(S,N,format,Int); // format is uninitialized
// cppcheck-suppress redundantCopy
// 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 uninivar_vsnprintf(void) void uninivar_vsnprintf(void)