Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
if-statement with two checks with different data types
#2
Both of (a > 3) and (b > 5u) have int type according to the C standard and an effectively Boolean type for purposes of MISRA C as described in the Glossary.

There is no arithmetic type conversion taking place on the operands of the && operator. Depending on the definition of the types t_int8 and t_uint16, there may be promotion and/or balancing conversions taking place on the operands of the > operators but these have no effect on the type of their results.

It seems that the MISRA checker that you are using is not configured properly or is not performing the check correctly.
Posted by and on behalf of the MISRA C Working Group
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)