Is this legal C?
chris at umcp-cs.UUCP
chris at umcp-cs.UUCP
Wed Nov 23 10:19:29 AEST 1983
if (0) retry: printf ("foo\n");
...
goto retry;
Looks like legal C to me, although I suspect that it's more likely to
compile on every compiler if you put { } around the "retry: printf"
part... (just because someone's compiler may interpret a label as a
statement -- which it is not, but that makes no difference in most
cases).
In fact, the ability to write this kind of thing is one of the big
gripes that some optimizer-people have with C. These people hate
unrestricted gotos. (Admittedly the example is really a restricted
goto and could be optimized.)
--
In-Real-Life: Chris Torek, Univ of MD Comp Sci
UUCP: {seismo,allegra,brl-bmd}!umcp-cs!chris
CSNet: chris at umcp-cs ARPA: chris.umcp-cs at CSNet-Relay
More information about the Comp.lang.c
mailing list