Portable uses of jmpbuf's

Doug Gwyn gwyn at smoke.ARPA
Wed Oct 12 16:20:17 AEST 1988


In article <4700022 at m.cs.uiuc.edu> wsmith at m.cs.uiuc.edu writes:
>Some machines define a jmpbuf to be struct { stuff } , while
>others define a jmpbuf to be an array.

It's supposed to be an array, since the address of the buffer
is fed to the setjmp/longjmp routines by name and only an array
works right in that context.

Your trick of wrapping it in a structure is okay so long as
you make sure it is the jmpbuf member of the structure you
feed to setjmp/longjmp, not the (address of) the structure.



More information about the Comp.lang.c mailing list