#3874 added missing testcase to avoid false positives

This commit is contained in:
Ettl Martin 2012-06-10 18:36:19 +02:00
parent 160fa94a02
commit c9cb492bc7
1 changed files with 8 additions and 0 deletions

View File

@ -4491,6 +4491,14 @@ private:
" return strncmp(buf1, foo(buf2), sizeof(buf1)) == 0;\n"
"}");
ASSERT_EQUALS("[test.cpp:2]: (warning, inconclusive) Using size of pointer buf1 instead of size of its data.\n", errout.str());
// #ticket 3874
check("void f()\n"
"{\n"
" int * pIntArray[10];\n"
" memset(pIntArray, 0, sizeof(pIntArray));\n"
"}\n");
ASSERT_EQUALS("", errout.str());
}
void check_signOfUnsignedVariable(const char code[], bool inconclusive=false) {