12-07-2024, 11:56 AM
You're right that the goto is enclosed by the IF, the labelled statement case 0 and the switch body, however L3 is only directly enclosed by the labelled statement case 1 - so is not allowed by this rule.
In addition, the label L3 is part of a switch label group, which is not allowed by 9.4.2 amplification item 3.
In addition, the label L3 is part of a switch label group, which is not allowed by 9.4.2 amplification item 3.
Posted by and on behalf of
the MISRA C++ Working Group
the MISRA C++ Working Group