Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
15.2 and 'break's inside if-else
#4
Yes, the break statement must be present even if preceded by a return statement.

Using a return statement in this way will break Rule 14.7. There is then a choice of using the break statement, thereby violating Rule 14.1, or omitting it and violating Rule 15.2.

Either way will violate two rules.
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)