#5970 false positive in Uninitialized variable: d - casting struct var to char*. It got fixed since 1.72, add regression test

This commit is contained in:
Alexander Mai 2016-05-14 22:36:54 +02:00
parent 2cb03b3fd0
commit 4816394511
1 changed files with 12 additions and 1 deletions

View File

@ -71,8 +71,8 @@ private:
TEST_CASE(uninitvar_cpp11ArrayInit); // #7010
TEST_CASE(uninitvar_rangeBasedFor); // #7078
TEST_CASE(trac_4871);
TEST_CASE(syntax_error); // Ticket #5073
TEST_CASE(trac_5970);
// dead pointer
TEST_CASE(deadPointer);
@ -3770,6 +3770,17 @@ private:
ASSERT_THROW(checkUninitVar(code), InternalError);
}
void trac_5970() { // Ticket #5073
checkUninitVar("void DES_ede3_ofb64_encrypt() {\n"
" DES_cblock d; \n"
" char *dp; \n"
" dp=(char *)d; \n"
" init(dp); \n"
"}", "test.c");
ASSERT_EQUALS("", errout.str());
}
void checkDeadPointer(const char code[]) {
// Clear the error buffer..
errout.str("");