setjmp(), register vars and the proposed standard

Doug Gwyn <gwyn> gwyn at brl-tgr.ARPA
Fri Nov 2 14:24:47 AEST 1984


> This is how the library subsection of the proposed ANSI standard
> reads for setjmp()/longjmp():
> 
> > All accessible objects have value as of the time longjmp was called,
> > except for objects of storage class auto or register whose values
> > have been changed between the setjmp and longjmp calls. These values
> > are undefined.
> 
> Given that many processors don't automatically push any kind of register
> mask on the stack (as VAXen do) this seems like a 'safe and sane' approach.

I can see the problem with registers, but why can't one count on autos
retaining their values??



More information about the Comp.lang.c mailing list