From f94e2088622ed230925000cf393ace51aaca62be Mon Sep 17 00:00:00 2001 From: Alexander Mai Date: Mon, 1 Sep 2014 19:53:24 +0200 Subject: [PATCH] #6116 False positive uninitvar - first argument to wcstombs(). Correct stf.cfg --- cfg/std.cfg | 2 -- test/testuninitvar.cpp | 12 ++++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/cfg/std.cfg b/cfg/std.cfg index c1ba3c546..d199c514b 100644 --- a/cfg/std.cfg +++ b/cfg/std.cfg @@ -197,14 +197,12 @@ false - false - diff --git a/test/testuninitvar.cpp b/test/testuninitvar.cpp index 0d1b94a27..7be3831e4 100644 --- a/test/testuninitvar.cpp +++ b/test/testuninitvar.cpp @@ -3711,6 +3711,18 @@ private: " putchar (*c);\n" "}"); ASSERT_EQUALS("", errout.str()); + + // #6116 False positive uninitvar - first argument to wcstombs() + checkUninitVar("void f( wchar_t *wstr) {\n" + " char buf[10];\n" + " wcstombs (buf, wstr, 3);\n" + "}"); + ASSERT_EQUALS("", errout.str()); + checkUninitVar("void f( char *str) {\n" + " wchar_t wbuf[10];\n" + " mbstowcs (wbuf, str, 3);\n" + "}"); + ASSERT_EQUALS("", errout.str()); } void checkDeadPointer(const char code[]) {