Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!uwvax!oddjob!gargoyle!ihnp4!upba!qetzal!rcw From: rcw@qetzal.UUCP (sysop) Newsgroups: comp.lang.c Subject: Re: goto's in C: an opinion... Message-ID: <184@qetzal.UUCP> Date: Sun, 2-Aug-87 02:14:57 EDT Article-I.D.: qetzal.184 Posted: Sun Aug 2 02:14:57 1987 Date-Received: Tue, 4-Aug-87 06:27:30 EDT References: <3289@bigburd.PRC.Unisys.COM> <7571@beta.UUCP> <6603@think.UUCP> <1125@nu3b2.UUCP> Organization: Graphics Information, Inc., Denver, CO. Lines: 44 Keywords: C, goto, style Summary: basis for error system In article <1125@nu3b2.UUCP>, rwhite@nu3b2.UUCP (Robert C. White Jr.) writes: [The Robert C. White, Jr. quoted is not me. I am the other one] > > In all your goto stuff I find that what you really want is the > setjump() longjump() construct which has been in all [both might > be a better word, its been marginally over three] the compilers > I have had to work with. It would seem to address all your examples > of necessary goto(s). > I agree! We have used setjump() and longjump() to develop an error system for software development in-house. This allows us 1. To set an error control point. 2. To Remove an error control point. 3. Return to previous error control point. 4. Handle cleanup. 5. Eliminate a lot of code like: if (status == BARF) barfflag++; This sort of code usually constitutes > 1/3 the project. 6. Allow error logging in a journal. We have created quite a few utility routines which eliminate the need for the programmer to constantly check status. For example, we have a routine U_open, which is an interface to open(). fd = U_open("Foo",O_RDWR,0666); The U_open routine issues the appropriate message to the user's terminal if there is a problem. You don't have to check errno or fd yourself, just open it and away you go. Unfortunately, our code is proprietary, but I can hitch you up with an excellent consultant who can provide an excellent error system for you. -- Robert C. White, Jr. Graphics Information, Inc. **************** UUCP: ihnp4!upba!qetzal!rcw isis!qetzal!rcw * OIL/GAS/LAND * USPS: 3067 Robin Way, Denver, CO 80222 * CARTOGRAPHY * ATT : +1 303 759-3666 ****************