storage class "private"
Roger Hayes
rogerh at arizona.UUCP
Sun Sep 30 06:37:54 AEST 1984
(In reference to Guy Harris' contention that a C compiler can't prohibit you
from taking the address of a variable declared "private")
A C compiler most certainly can! Try taking the address of a register
variable.
I like the idea of class private -- it does add to the set of possible
optimizations. Is there a cleaner way to do it? I suppose that the
compiler could collect information about aliasing, but that isn't in
general computable.
Why, oh why, don't C compilers optimize? I am tired of hacking source
in order to get the code I know I want -- the technology certainly
exists to let the compiler do most of that work for me. An example
is using a pointer variable instead of array indexing in a 'for' loop --
for maximum efficiency, I have to write:
{ struct foo *foop = fooarr;
for (i=0, i < FOOMAX; i++)
dostuff(*(foop++));
}
instead of what I mean:
for (i=0; i < FOOMAX; i++)
dostuff(fooarr[i]);
On another issue, I like the recent sugggestion that, in macro expansion,
the formals should have a special status. The formals should be string-
expanded (ie, whether inside quotes or not); other macros should not.
Roger Hayes
University of Arizona, Dept of Computer Science
rogerh at Arizona.CSNET
rogerh at arizona.UUCP
More information about the Comp.lang.c
mailing list