The world is not ready for 'volatile'

Doug Gwyn gwyn at smoke.BRL.MIL
Mon Jan 2 12:20:50 AEST 1989


>[I wrote:]
>>A STORAGE CLASS by no means obviates the need for type qualifiers.

In article <15171 at mimsy.UUCP> chris at mimsy.UUCP (Chris Torek) writes:
>I did not say that.  I said `register implies not-volatile, not-
>aliased': that `volatile register' and `aliased register' are
>nonsensical combinations.

Of course there are nonsensical expressions in ANY version of C
that are not ruled "illegal" just because they're useless.
But I thought you were trying to claim that "volatile" could have
been dispensed with and the necessary additional semantics
invested in "register", and THAT is what I dispute, because type
qualifiers can apply at any of the "levels" of a type
declaration, unlike storage class specifiers (which apply to the
identifier, in effect).  Thus
	register const int * volatile * const ptr = SOMETHING;
has a well-defined and possibly useful meaning, which would be
impossible (I think) to mimic correctly by stretching "register"
to serve as a type qualifier while not breaking existing usage
of "register".  In any case the switch from a storage class
specifier to a type qualifier would be pretty drastic!



More information about the Comp.lang.c mailing list