Array bounds checking with C????

Henry Spencer henry at zoo.toronto.edu
Sat Sep 1 02:38:05 AEST 1990


In article <988 at christopher-robin.cs.bham.ac.uk> cjr at christopher-robin.UUCP (Chris Ridd <RiddCJ>) writes:
>  Why is this?  I never could figure out why accessing the first
>element *past* the end of an array should be legal.

*Accessing* it is not legal, but taking its address is.  This is arguably
regrettable, but vast amounts of C code depend on it, and it is not a
serious problem to implement.
-- 
TCP/IP: handling tomorrow's loads today| Henry Spencer at U of Toronto Zoology
OSI: handling yesterday's loads someday|  henry at zoo.toronto.edu   utzoo!henry



More information about the Comp.lang.c mailing list