Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!usc!sdd.hp.com!elroy.jpl.nasa.gov!decwrl!sgi!davea@quasar.wpd.sgi.com From: davea@quasar.wpd.sgi.com (David B.Anderson) Newsgroups: comp.sys.sgi Subject: Re: Bug or feature of the level 2 C optimizer? Message-ID: <91144@sgi.sgi.com> Date: 14 Mar 91 16:56:34 GMT References: <1991Mar14.014517.26603@jarvis.csri.toronto.edu> Sender: guest@sgi.sgi.com Reply-To: davea@quasar.UUCP (David B.Anderson) Distribution: na Organization: Silicon Graphics, Inc., Mountain View, CA Lines: 23 In article <1991Mar14.014517.26603@jarvis.csri.toronto.edu> lansd@dgp.toronto.edu (Robert Lansdale) writes: > > For the longest while I've have had problems with longjmp()'s >and level 2 optimizations in my rendering system. If an error occured >during the loading of a script file then the program would go into an >endless loop re-reading the first line of the file. The problem was >non-existent for the non-optimized version. [stuff deleted ] > char *user_script_file = "test.file"; [stuff deleted ] For correct operation, modify this to: char * volatile user_script_file = "test.file"; The extra assignment you found effective is not guaranteed to work. See the ANSI C Rationale on longjmp for further information. Page 86. Also see the longjmp man page. Regards, [ David B. Anderson Silicon Graphics (415)335-1548 davea@sgi.com ] [``What can go wrong?'' --Calvin to Hobbes]