volatile, noalias and optimization
Eddie Wyatt
edw at IUS1.CS.CMU.EDU
Thu Apr 28 01:03:55 AEST 1988
>> 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 at 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 at ius1.cs.cmu.edu
More information about the Comp.lang.c
mailing list