The first one is not allowed, but the reason is that you can't apply a label to a declaration.
The label comes before the scope of the VLA, and if there were executable code (formally, a statement; even an empty one would do) to label, then you'd be OK:
goto inside;
{
inside:;
int a[n]; // Scope of a starts here!
}
Both the goto outside
fragments are fine.
There was a discussion about the scope of identifiers in comments, and when the array a[n]
comes into scope.
The standards (both C99 and C11 — in the same section number) say:
6.2.1 Scopes of identifiers
¶7 Structure, union, and enumeration tags have scope that begins just after the appearance of
the tag in a type specifier that declares the tag. Each enumeration constant has scope that
begins just after the appearance of its defining enumerator in an enumerator list. Any
other identifier has scope that begins just after the completion of its declarator.
It was in §6.1.2.1 in the C90 standard, but the wording was the same.