Bug or feature of the level 2 C optimizer?

David B.Anderson davea at quasar.wpd.sgi.com
Fri Mar 15 02:56:34 AEST 1991


In article <1991Mar14.014517.26603 at jarvis.csri.toronto.edu> lansd at 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 at sgi.com ]
[``What can go wrong?''                           --Calvin to Hobbes]



More information about the Comp.sys.sgi mailing list