27-04-2006, 10:05 AM
Code:
if ( ( x == y ) | ( y == a ) ) /*Violation?, could || have been meant?*/
{
}
a = a + y + x + ( x || y );
These are violations of 12.6. as effectively boolean expressions are being used as the operand of an operator other than &&, || and !.
Code:
int32_t x = 5;
int32_t y = 11;
if ( x || y ) /*Could this be a violation??? because x and y are not effectively boolean*/
{
}
This is a violation of the first sentence of 12.6.
Posted by and on behalf of the MISRA C Working Group