Path: utzoo!mnetor!uunet!husc6!mailrus!ames!oliveb!sun!limes From: limes@sun.uucp (Greg Limes) Newsgroups: comp.lang.c Subject: Re: Optimization (was Re: volatile) Message-ID: <50739@sun.uucp> Date: 25 Apr 88 17:25:26 GMT References: <13074@brl-adm.ARPA> <280@fxgrp.UUCP> Reply-To: limes@sun.UUCP (Greg Limes) Organization: Sun Microsystems, Mountain View Lines: 27 In article <280@fxgrp.UUCP> ljz@fx.com (Lloyd Zusman) writes: >The ANSI committee could specify that the 'volatile' #pragma option either >does nothing (without generating an error) or else work as 'volatile' >is now specified. Wouldn't this be more satisfactory than the current >proposal? Who do I send my vote for "#pragma volatile" to? Methinks this is an implementation issue, for which the manual would read: -O# Optimises uses of external variables. Any external variables that may be modified asynchronously, i.e. external device registers or variables modified in signal handlers, should be marked as "volatile" by use of the statment #pragma volatile(foo, bar) since this is not part of the language. Currently, SUN has a warning in the manual that the higher levels of optimization should not be used when compiling programs that modify external variables from within signal handlers. Can you say "implementation issue"? I knew you could. DISCLAIMER: I am not in the compler group, and do not speek for them. -- Greg Limes [limes@sun.com] frames to /dev/fb