setjmp/longjmp question

Henry Spencer henry at utzoo.uucp
Sat Mar 4 02:26:17 AEST 1989


In article <419 at chem.ucsd.EDU> tps at chem.ucsd.edu (Tom Stockfisch) writes:
>>>Would longjmp() clober all local variables...
>
>>It could.
>
>Even if the local variable is an array?

Yes.  Absolutely no promises are made about the fate of local variables,
in the absence of "volatile".  Don't forget that there are machines in
which registers are addressable, and on those machines it is possible
(although perhaps seldom sensible) to put (small) arrays in registers.
Also, it isn't necessarily true that arrays *must* be in addressable
storage.  In the general case, with pointers being passed around with
wild abandon, they have to be.  But many functions use arrays in much
more disciplined ways, such that the compiler can completely understand
what is going on.  In such cases, a clever compiler might be able to
put arrays into things like Cray vector registers.
-- 
The Earth is our mother;       |     Henry Spencer at U of Toronto Zoology
our nine months are up.        | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list