Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!sunybcs!boulder!gore!jacob From: jacob@gore.com (Jacob Gore) Newsgroups: comp.lang.c Subject: Re: Re: Errors aren't that simple Message-ID: <470008@gore.com> Date: 2 Mar 90 01:12:05 GMT References: <8192@hubcap.clemson.edu> Reply-To: jacob@gore.com (Jacob Gore) Organization: Gore Enterprises Lines: 29 / comp.lang.c / billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu (William Thomas Wolfe, 2847 ) / Mar 1, 1990 / > The [AT&T long distance netrowk] crash apparently was caused by a > programmer who used a "break" > within an if (which itself was within a switch) for the purpose of > exiting the if; the real result was to exit the switch instead. So what else is new? In the following Ada code the "exit" will exit the loop instead of the 'if' statement: loop ... if ... then ... exit; end if; ... end loop; In C, 'break' exits switches and loops. Not ifs. > If C provided a case statement rather than a switch..break system, then > the error would most likely have been prevented. unless the whole thing was enclosed in a loop, which would be exited instead of the 'if'. Jacob -- Jacob Gore Jacob@Gore.Com boulder!gore!jacob