Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!lavaca.uh.edu!menudo.uh.edu!sugar!ficc!peter From: peter@ficc.ferranti.com (Peter da Silva) Newsgroups: comp.lang.c Subject: Re: Ambiguity in definition of setjmp/longjmp makes them much less useful Message-ID: <:_A6T46@xds13.ferranti.com> Date: 9 Oct 90 18:13:46 GMT References: <891@usage.csd.unsw.oz.au> Reply-To: peter@ficc.ferranti.com (Peter da Silva) Organization: Xenix Support, FICC Lines: 14 In article <891@usage.csd.unsw.oz.au> cameron@spectrum.cs.unsw.oz.au (Cameron Simpson) writes: > But think about what happens when you write > sigfn(sig) { longjmp(foojmpbuf,1); } > Since, as you say, a signal can happen anywhere then there is now a might-goto > arc from _every_ point in the program which can conceivably be called from > within any function which uses foojmpbuf as a jump buffer. I think it reasonable not to guarantee longjmp behaviour from within signals. In fact, calling longjmp from within signals is evil. The only thing you should do within a signal routine is set a flag... anything else is a bug waiting to happen. Of course, you need to do this in BSD, but BSD is buggier than a dog pound. -- Peter da Silva. `-_-' +1 713 274 5180. 'U` peter@ferranti.com