Can ANSI Standard C be "Optimized"

Tim Maroney tim at unc.UUCP
Thu Mar 29 07:27:15 AEST 1984


J  Rather than add the "volatile" attribute to variable
O  declarations, the C standards committee has taken a safer
H  alternative:  Assume that everything is volatile, but permit it
N  to be declared "const".  An object declared "const" cannot be
.  modified.  Furthermore, the "const" attribute can appear at each
J  level of indirection; eg
O
H          const char *pcc;
N
.  declares a (modifiable) pointer, which is guaranteed by the
J  programmer to point to non-modifiable storage (a const char).

This does not speak to the problem at hand at all, which is making it
possible to optimize code containing references to data which may be changed
by external events.

By the way, I am somewhat distressed that everyone has decided to talk about
string and array comparisons, which were just an aside at the end of the
article on improving C's generality, and which really are not very
interesting and add nothing to C's generality.  Doesn't anyone have anything
to say about the rest of my suggestions?  Even flames?
--
Tim Maroney, The Censored Hacker
mcnc!unc!tim (USENET), tim.unc at csnet-relay (ARPA)

All opinions expressed herein are completely my own, so don't go assuming
that anyone else at UNC feels the same way.



More information about the Comp.lang.c mailing list