28-09-2010, 07:06 AM
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 areorCode:break ;
Your example hasCode:break ; }
and thus does not comply (with Rule 15.0).Code:break ; } }
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?