C pet peeve

tektronix!zehntel!sytek!menlo70!hao!hplabs!hpda!fortune!megatest!sun!gnu tektronix!zehntel!sytek!menlo70!hao!hplabs!hpda!fortune!megatest!sun!gnu
Sun Mar 20 21:03:32 AEST 1983


Clearly if this person is writing programs with subscripts it's not
"really" written in C.  Real C programmers always use pointers, which
can't be checked without immense overhead or super intelligence in the
compilation environment.  (Since by definition a subscription is equivalent
to a pointer add then dereference, it's not clear to me that you could
check subscripting without checking pointers without violating the
language definition.)

I can see it now -- programs written with  *(p+i) in places where it
is known that subscript checking would fail, or in inner loops where speed
is important.  ("Daddy, why didn't he just write p[i]?"  "Obscure historical
reasons, Susie."  "But Daddy, the program stops working when I change it...")

	John Gilmore, Sun Microsystems



More information about the Comp.lang.c mailing list