Path: utzoo!attcan!uunet!ingr!crossgl From: crossgl@ingr.com (Gordon Cross) Newsgroups: comp.lang.c Subject: Re: Behaviour of setjmp/longjmp and registers Message-ID: <3630@ingr.com> Date: 23 Jan 89 19:17:42 GMT References: <25@torsqnt.UUCP> <8867@bloom-beacon.MIT.EDU> <7222@polyslo.CalPoly.EDU> <8812@alice.UUCP> <9480@smoke.BRL.MIL> Reply-To: crossgl@ingr.UUCP (Gordon Cross) Organization: Intergraph Corp. Huntsville, Al Lines: 20 In article <9480@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes: > >I don't think I've even seen a case in which setjmp/longjmp was the best >way to design code, let alone essential. I tend to disagree with this. I do avoid the use of setjmp/longjmp where they are not needed but try to correctly handle error recovery in a large interactive program without them! I have developed a caller-configurable error processor that takes care of such monsters nicely: an error is reported, handled, and recovered from simply by using something like if (read (descriptor, buffer, sizeof (buffer)) == -1) report_error (READFAIL, ERR_FATAL); do_normal_stuff (); /* report_error does NOT return on FATAL!! */ -- Gordon Cross UUCP: uunet!ingr!crossgl "all opinions are 111 Westminister Way INTERNET: crossgl@ingr.com mine and not those Madison, AL 35758 MA BELL: (205) 772-7842 of my employer."