Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!mintaka!bloom-beacon!eru!hagbard!sunic!compuram!pgd From: pgd@bbt.se Newsgroups: comp.lang.c Subject: Re: Ambiguity in definition of setjmp/longjmp makes them much less useful Message-ID: <1990Oct15.174203.21441@bbt.se> Date: 15 Oct 90 17:42:03 GMT References: <1597@redsox.bsw.com> <1990Oct09.143521.24019@unx.sas.com> <1990Oct10.152659.6334@zoo.toronto.edu> Organization: . Lines: 15 In article <1990Oct10.152659.6334@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) writes: >In article <1990Oct09.143521.24019@unx.sas.com> sasrer@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.)