diff --git a/cfg/std.cfg b/cfg/std.cfg
index 6266f35ca..c65f16c1d 100644
--- a/cfg/std.cfg
+++ b/cfg/std.cfg
@@ -2347,7 +2347,9 @@
false
-
+
+
+
diff --git a/test/cfg/std.c b/test/cfg/std.c
index 7e41ab410..f43a8acaf 100644
--- a/test/cfg/std.c
+++ b/test/cfg/std.c
@@ -1642,13 +1642,21 @@ void uninitvar_mbsinit(void)
(void)mbsinit(ps);
}
-void uninitvar_mbstowcs(void)
+void uninitvar_mbstowcs(wchar_t* d, const char* s, size_t m)
{
- wchar_t *ws;
- char *s;
- size_t n;
+ wchar_t *dest;
+ char *src;
+ size_t max;
+
// cppcheck-suppress uninitvar
- (void)mbstowcs(ws,s,n);
+ (void)mbstowcs(dest,s,m);
+ // cppcheck-suppress uninitvar
+ (void)mbstowcs(d,src,m);
+ // cppcheck-suppress uninitvar
+ (void)mbstowcs(d,s,max);
+
+ // No warning is expected
+ (void)mbstowcs(d,s,m);
}
void uninitvar_mbsrtowcs(wchar_t* d, const char** s, size_t m, mbstate_t *p)
@@ -1657,6 +1665,7 @@ void uninitvar_mbsrtowcs(wchar_t* d, const char** s, size_t m, mbstate_t *p)
const char* src;
size_t max;
mbstate_t* ps;
+
// cppcheck-suppress uninitvar
(void)mbsrtowcs(dest,s,m,p);
// cppcheck-suppress uninitvar