jump tables (was Re: Why no labelled loops?)

franka at mntgfx.UUCP franka at mntgfx.UUCP
Tue Mar 3 06:57:20 AEST 1987


In article <5626 at mimsy.UUCP> chris at mimsy.UUCP (Chris Torek) writes:
>In article <545 at mntgfx.MENTOR.COM> franka at mntgfx.MENTOR.COM (Frank A.
>Adrian) writes:

>>Now for my pet peeve.
>(Well, *he* spells it right. :-) )
Thank you...

>>it is not any more hazardous than the goto statement itself,
>Not so!  The existing C `goto' can never change function contexts.
>Only `longjmp' has this power.  Label assignments, unless they are
>severely restricted, one can do non-local `goto's quite easily.
>This also means that the label type must carry around a lot of
>extra baggage, which has a tendency to destroy much of the efficiency
>you thought you were gaining.

Ah yes, the fly in the ointment.  I had for gotten about the nasty little
non-localities one can introduce with this feature.  I'd say just don't
let label arrays be passed or used non-locally, but this introduces another
non-orthogonal feature into the language and I hate non-orthogonal constructs
even more than the inconvenience of assembly code.  I'll "cry uncle" on this
one.

Frank Adrian
Mentor Graphics, Inc.



More information about the Comp.lang.c mailing list