Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!killer!chasm From: chasm@killer.UUCP (Charles Marslett) Newsgroups: comp.lang.c Subject: Re: volatile, noalias and optimization Message-ID: <3939@killer.UUCP> Date: 27 Apr 88 05:32:29 GMT References: <20345@pyramid.pyramid.com> <132@atpal.UUCP> Organization: The Unix(R) Connection, Dallas, Texas Lines: 28 Summary: counterproposal In article <132@atpal.UUCP>, tneff@atpal.UUCP (Tom Neff) writes: > 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. Thus /volatile/ > says "treat this variable no different syntactically, in type, usage etc., > but DON'T optimize access to its memory location when you generate code; > go 'to the metal' every blessed time." This is a wonderful feature to > have, a real "plus" for systems work... but shouldn't we use > > #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 "void" is documentation/lintification feature that probably doesn't serve its purpose near as well as "volatile" does its own. Sure the language becomes a bit more verbose, somewhat more difficult to read (somewhat more like Pascal (?)), but the inferences are useful when you need them, and I don't like "#pragma" as a compiler directive any more than I did "#line" -- kludges, only if you gotta use 'em! Did I step on any toes this time? > Tom Neff UUCP: ...uunet!pwcmrd!skipnyc!atpal!tneff Charles Marslett chasm@killer.UUCP