Uninitialized variables; Added true positive test
This commit is contained in:
parent
b61eaec5b4
commit
8d97cce81b
|
@ -1625,6 +1625,12 @@ private:
|
|||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
checkUninitVar("void foo() {\n"
|
||||
" char buf[1024];\n"
|
||||
" char x = *(char *) (((uintptr_t) buf + 63) & ~(uintptr_t) 63);\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("[test.cpp:3]: (error) Uninitialized variable: buf\n", errout.str());
|
||||
|
||||
// Passing array to function
|
||||
checkUninitVar("void f(int i);\n"
|
||||
"void foo()\n"
|
||||
|
|
Loading…
Reference in New Issue