setjmp: read the manual

jim at ism780b.UUCP jim at ism780b.UUCP
Thu Oct 18 14:31:46 AEST 1984


>There's a good reason for doing it the other way: efficiency.

Since when is efficiency an issue in regard to setjmp/longjmp?


>The Sun
>(4.2 on 68010's) setjmp(3) says:
>
>       "All memory-bound data have values as of the time longjmp was called.
>        The machine registers are restored to the values they had at the time
>        setjmp was called.  But, because the register storage class is
>        only a hint to the C compiler, variables declared as register
>        variables may not necessarily be assigned to machine registers,
>        so their values are unpredictable after a longjmp.  This is
>        especially a problem for programmers trying to write machine-
>        independent C routines."

I wouldn't let anyone who write such garbledy-goop anywhere near my manuals.
Why not just say the values of register variables local to a setjmp call
are unpredictable following a return via longjmp, period?

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



More information about the Comp.lang.c mailing list