Path: utzoo!mnetor!uunet!husc6!bbn!rochester!pt.cs.cmu.edu!IUS1.CS.CMU.EDU!edw From: edw@IUS1.CS.CMU.EDU (Eddie Wyatt) Newsgroups: comp.lang.c Subject: Re: volatile, noalias and optimization Message-ID: <1547@pt.cs.cmu.edu> Date: 27 Apr 88 15:03:55 GMT References: <20345@pyramid.pyramid.com> <132@atpal.UUCP> <3939@killer.UUCP> Sender: netnews@pt.cs.cmu.edu Organization: Carnegie-Mellon University, CS/RI Lines: 41 >> It's been pointed out at some length that the new /volatile/ and /noalias/ >> keywords are really all about controlling the optimizer in various C >> implementations, more than about the language itself. >> >> #pragma volatile(var1, var2, var3) >> >> instead of imposing a new keyword on the language grammar? And ditto for > > I'll go along with this if we will (for consistency sake) also banish > "register", "short" and "void" with it. They all have similar impure > usage. "Register" is even an optimizer directive, if I ever saw one. And The criticism of volatile comes mainly from the fact that it's use is more for the optimzer than an aid to the programmer. Register is the only construct you have named above that could directly affect the optimizer. So it is the only construct of relevance that analogies could be drawn from. People have also criticized register for it's role as a optimization hint. > [ranting deleted ] > > Did I step on any toes this time? > Not really, you only show your lack of understanding for the opposing position on volatile. > Charles Marslett > chasm@killer.UUCP I believe that if the non-volatile concept is to be adopted as the default for variables then the volatile declaration should be provided via keyword. The current utilization of the language would dictate the need for such a sematic construct. So it should also be adopted in the syntax. However, if you were to ask me whether I believed non-volatile should be the default, well that's another question. I'm kind of swaying between the the fundalmentist view and realizes what the pragmaitcs are for both sides. -- Eddie Wyatt e-mail: edw@ius1.cs.cmu.edu