I did this simple test
static BOOL Test(U16 zCase) { BOOL zResult;
switch ( zCase ) { case 1: zResult = TRUE; break;
case 2: zResult = FALSE; break; default: break;
}
return zResult; }
I would expect a cppchcek warning because zResult can have an unknown value .. isn't it? Thanks Michele
Yes we should write an error for that.
There is a ticket:
http://trac.cppcheck.net/ticket/4784
Btw.. it is interesting if you can find some more simple cases. I doubt that we have thought about all possible cases. Thanks!
Yes, for sure. Michele
Log in to post a comment.
I did this simple test
static BOOL Test(U16 zCase)
{
BOOL zResult;
switch ( zCase )
{
case 1:
zResult = TRUE;
break;
}
return zResult;
}
I would expect a cppchcek warning because zResult can have an unknown value .. isn't it?
Thanks
Michele
Yes we should write an error for that.
There is a ticket:
http://trac.cppcheck.net/ticket/4784
Btw.. it is interesting if you can find some more simple cases. I doubt that we have thought about all possible cases. Thanks!
Yes, for sure.
Michele