Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 15.2: MISRA warning is not generated
#3
William Forbes Wrote:The section at the beginning of the section 6.15 is considered normative and is known by Rule 15.0.
Here, I think you'll find that your example breaks the rule for the syntax of a "case-clause".
Note that the only legal terminating token sequences are
Code:
break ;
or
Code:
break ; }
Your example has
Code:
break ; } }
and thus does not comply (with Rule 15.0).

If we understand the reply as "Whatever be the number of paths we traverse within a case statement, finally the case statement should end with an explicit break. It is not acceptable to have three break statements from three different paths", then should we not get a MISRA warning when we write a break statement within an if/else block?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 4 Guest(s)