Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!nysernic!itsgw!batcomputer!cornell!rochester!pt!ius1.cs.cmu.edu!edw From: edw@ius1.cs.cmu.edu (Eddie Wyatt) Newsgroups: comp.lang.c Subject: Re: goto's and switch statements -- mild proposal Message-ID: <1032@ius1.cs.cmu.edu> Date: Tue, 11-Aug-87 09:51:32 EDT Article-I.D.: ius1.1032 Posted: Tue Aug 11 09:51:32 1987 Date-Received: Thu, 13-Aug-87 06:11:18 EDT References: <855@tjalk.cs.vu.nl> <2683@hoptoad.uucp> <916@haddock.ISC.COM> Organization: Carnegie-Mellon University, CS/RI Lines: 26 Summary: y In article <916@haddock.ISC.COM>, karl@haddock.ISC.COM (Karl Heuer) writes: > In article <2683@hoptoad.uucp> gnu@hoptoad.uucp (John Gilmore) writes: > >What bothers me is that I can't say ["goto default" and "goto case N"]. > > It's interesting that this restriction exists, in view of the oft-stated claim > that the reason that switch statements have automatic fallthrough (rather than > automatic breakswitch) is that "case labels are just like real labels". > > Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint Consider the problems "goto case N" cause when there are two switch statements each with a case N label in the function block. Also just consider how you would implement the two switch statements each with a case N label. Since each label is a posible target of a goto, it must be put into a label table for that function block. Now you have multiple defined labels (label N) unless you do a few ugly things to uniquely define each label - but then look up on labels become more expensive. -- Eddie Wyatt e-mail: edw@ius1.cs.cmu.edu