Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: Notesfiles; site gypsy.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!siemens!gypsy!rosen From: rosen@gypsy.UUCP Newsgroups: net.unix-wizards Subject: Bug iwith setjmp/longjmp on Vax Message-ID: <44700008@gypsy.UUCP> Date: Thu, 6-Jun-85 16:19:00 EDT Article-I.D.: gypsy.44700008 Posted: Thu Jun 6 16:19:00 1985 Date-Received: Fri, 7-Jun-85 03:53:45 EDT Lines: 52 Nf-ID: #N:gypsy:44700008:000:905 Nf-From: gypsy!rosen Jun 6 16:19:00 1985 /* 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? I've been told that this program is too simple for setjmp() and longjmp(). This appears to be true, because if I complicate the code just a bit, it will work. What's going on? */ /* setjmp() - longjmp() test program */ #include static jmp_buf env; int mode; main(){ foo(); longjmp(env, 1); } foo(){ mode = setjmp(env); if (mode != 0) magic(); } magic() { printf("HERE I AM\n"); exit(0); } /* End of code */ /* Steve Rosen Siemens Research and Technology Laboratories Princeton, NJ USENET: {ihnp4|princeton|adrvax}!siemens!rosen ARPA: princeton!siemens!rosen@TOPAZ */