Test case for #863 (false positive memset array of pointers)
http://sourceforge.net/apps/trac/cppcheck/ticket/863
This commit is contained in:
parent
59acfbc4df
commit
0e695ea527
|
@ -1061,6 +1061,13 @@ private:
|
||||||
" memset(s, 5, '*');\n"
|
" memset(s, 5, '*');\n"
|
||||||
"}\n");
|
"}\n");
|
||||||
ASSERT_EQUALS("[test.cpp:4]: (possible error) The size argument is given as a char constant\n", errout.str());
|
ASSERT_EQUALS("[test.cpp:4]: (possible error) The size argument is given as a char constant\n", errout.str());
|
||||||
|
|
||||||
|
check("void foo()\n"
|
||||||
|
"{\n"
|
||||||
|
" int* x[5];\n"
|
||||||
|
" memset(x, 0, sizeof(x));\n"
|
||||||
|
"}\n");
|
||||||
|
ASSERT_EQUALS("", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void counter_test()
|
void counter_test()
|
||||||
|
|
Loading…
Reference in New Issue