Newsgroups: comp.lang.c Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: Volatile is Necessary Message-ID: <1988Apr1.233129.12808@utzoo.uucp> Organization: U of Toronto Zoology References: <17982@pyramid.pyramid.com> Date: Fri, 1 Apr 88 23:31:29 GMT > My guess is that some kind of declaration of setjmp itself > is necessary, to let the compiler know that nothing can be trusted > across this function call... If you inspect the X3J11 rules about setjmp carefully, you will see a set of restrictions aimed at making it easy for compilers to recognize it as a special case. Optimizing compilers undoubtedly will. Non- optimizing compilers will simply have to be a bit conservative. This is not a disaster. The current rules about automatic variables *are* a bit of a disaster, but nobody in his right mind will implement them (and some of us are going to try to get them changed). The traditional rule, that only explicitly-register variables are unsafe after longjmp, is adequate: any compiler that is smart enough to promote things into registers without being asked is smart enough to notice the setjmp and take precautions. -- "Noalias must go. This is | Henry Spencer @ U of Toronto Zoology non-negotiable." --DMR | {allegra,ihnp4,decvax,utai}!utzoo!henry