Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!snorkelwacker!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!warwick!nott-cs!christopher-robin.cs.bham.ac.uk!cjr From: cjr@cs.bham.ac.uk (Chris Ridd ) Newsgroups: comp.lang.c Subject: Re: Array bounds checking with C???? Message-ID: <990@christopher-robin.cs.bham.ac.uk> Date: 4 Sep 90 09:59:23 GMT References: <7611@ucdavis.ucdavis.edu> <26196@mimsy.umd.edu> <988@christopher-robin.cs.bham.ac.uk> <1990Aug31.163805.11232@zoo.toronto.edu> Reply-To: cjr@christopher-robin.UUCP (Chris Ridd ) Organization: University of Birmingham, England Lines: 20 In article <1990Aug31.163805.11232@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) writes: >In article <988@christopher-robin.cs.bham.ac.uk> cjr@christopher-robin.UUCP (Chris Ridd ) 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@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