Bug iwith setjmp/longjmp on Vax

stephen at dcl-cs.UUCP stephen at dcl-cs.UUCP
Sun Jun 9 14:25:26 AEST 1985


In article <44700008 at gypsy.UUCP> rosen at gypsy.UUCP writes:
>This program was compiled under 4.2BSD on a VAX; it doesn't work the way it
>should (I get a 'longjmp botch' message).  If I compile the same exact
>program on a Sun running 4.2BSD it works fine.  I know that setjmp() and
>longjmp() work on a Vax, but why is this simple program giving me a problem?
>
>/* setjmp() - longjmp() test program */
>#include <setjmp.h>
>static jmp_buf env;
>int mode;
>
>main(){
>	foo();
>	longjmp(env, 1);
>}
>
>foo(){
>
>  mode = setjmp(env);
>  if (mode != 0) magic();
>}
It has always been my understanding that "longjmp()" is used to jump OUT of
routines - not INTO them!
-- 
Name:	Stephen J. Muir			Project:Alvey ECLIPSE Distribution
JANET:	stephen at uk.ac.lancs.comp	DARPA:	stephen%lancs.comp at ucl-cs
UUCP:	...!ukc!icdoc!dcl-cs!stephen	Phone:	+44 524 65201 Ext. 4599
Post:	Department of Computing, University of Lancaster, Bailrigg, Lancaster.
	LA1 4YR



More information about the Comp.unix.wizards mailing list