setjmp: read the manual

jim at ism780b.UUCP jim at ism780b.UUCP
Thu Oct 18 14:32:41 AEST 1984


>>To fix a program that this breaks, you remove "register" declarations from
>>routines that call setjmp.  Not so bad.
>
>Don't you also have to start removing the register declarations in the
>functions that call functions that call setjmp?  Seems like you could
>lose their (parents to funcs that call setjmp) register values further
>down in the call chain also...

No.  If setjmp saves all registers and longjmp restores them, the registers
are back to what they were at the time of the setjmp, so the parent is ok
(unless your program is in the form of a temporal Klein Bottle, and the
instantiation of the routine that called the routine that called setjmp
happened after the call to setjmp, somehow :-)

-- Jim Balter, INTERACTIVE Systems (ima!jim)



More information about the Comp.lang.c mailing list