Array bounds checking with C????

Chris Ridd <RiddCJ> cjr at cs.bham.ac.uk
Tue Sep 4 19:59:23 AEST 1990


In article <1990Aug31.163805.11232 at zoo.toronto.edu>
henry at zoo.toronto.edu (Henry Spencer) writes:

>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.

  Thanks for the reminder!  I don't tend to use the technique much myself...

    Chris

-- Chris Ridd, Computer Science, Birmingham Uni, UK -- RiddCJ at Cs.Bham.Ac.Uk --

"'It's going to look pretty good, then, isn't it,' said War testily, 'the One
Horseman and Three Pedestrians of the Apocralypse.'" - Sourcery



More information about the Comp.lang.c mailing list