digitalmars.D.learn - undefined label
- Manfred Nowak <svv1999 hotmail.com> Aug 06 2005
- Chris Sauls <ibisbasenji gmail.com> Aug 07 2005
<code>
void main(){
end: ;
void f(){
goto end;
}
}
</code>
Why is `end' undefined?
-manfred
Aug 06 2005
Manfred Nowak wrote:<code> void main(){ end: ; void f(){ goto end; } } </code> Why is `end' undefined?
I won't swear to it: but probably because labels are specific to their scope. And/or because functions (even inline ones, technically) are anchored to their frame, so a 'goto' pointing outside that frame won't work. Same reason this doesn't: # void bob () { # L_inBob: ; # } # # void foo () { # goto L_inBob; # } -- Chris Sauls
Aug 07 2005








Chris Sauls <ibisbasenji gmail.com>