Ambiguity in definition of setjmp/longjmp makes them much less useful

pgd at bbt.se pgd at bbt.se
Tue Oct 16 03:42:03 AEST 1990


In article <1990Oct10.152659.6334 at zoo.toronto.edu> henry at zoo.toronto.edu (Henry Spencer) writes:
>In article <1990Oct09.143521.24019 at unx.sas.com> sasrer at unx.sas.com (Rodney Radford) writes:
>>I believe (just guessing really) that the original C used 'builtins' for the
>>setjmp/longjmp functions, ie: they special cased them.
>
>Nope.  The original pdp11 C compiler had a predictable stack-frame format
>and could do stack unravelling right.

I am not 100% sure of this, but I think that the original C library
just restored some registers without any fancy unravelling. (r5,sp,pc).
It also kept all variables, except for register variables, in memory.

The original c-library also had nargs(), but that one was a horrible
kludge. (It was looking at the machine instructions to check out how
many bytes were popped from the stack after return from the call instruction.)



More information about the Comp.lang.c mailing list