Newsgroups: comp.lang.c Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: setjmp/longjmp question Message-ID: <1989Mar3.162617.16755@utzoo.uucp> Organization: U of Toronto Zoology References: <8514@polyslo.CalPoly.EDU> <1989Feb26.012335.12938@utzoo.uucp> <419@chem.ucsd.EDU> Date: Fri, 3 Mar 89 16:26:17 GMT In article <419@chem.ucsd.EDU> tps@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@zoo.toronto.edu