Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 14.4 and the explanation is not enough to understand why
#3
MISRA-C introduces a strong typing model to help users avoid unexpected issues which occur in the C typing model.
The rule prevents the accidental use of integer expression when a boolean expression was intended.

To be compliant with MISRA rule 14.4 you should write your test as a boolean expression:
Code:
if((udtEvents & udtSTOP_EVENT) != 0U  )
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)