01-07-2013, 10:11 AM
The Rule states that the label and the goto "shall be declared in the same block, or in any block enclosing the goto statement"
This rule applies to any block, not just control blocks.
The example cited is NON-COMPLIANT as label L1 is in a parallel block, not a block enclosing the goto.
This rule applies to any block, not just control blocks.
The example cited is NON-COMPLIANT as label L1 is in a parallel block, not a block enclosing the goto.
Code:
void f()
{
{
goto L1;
}
{
L1: /* Non-compliant */
}
}
Posted by and on behalf of the MISRA C Working Group