Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!snorkelwacker!paperboy!husc6!purdue!haven!mimsy!chris From: chris@mimsy.umd.edu (Chris Torek) Newsgroups: comp.lang.c Subject: Re: Array bounds checking with C???? Message-ID: <26216@mimsy.umd.edu> Date: 27 Aug 90 10:39:09 GMT References: <7611@ucdavis.ucdavis.edu> <26196@mimsy.umd.edu> <619.26d6cfb2@iccgcc.decnet.ab.com> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 19 In article <26196@mimsy.umd.edu> I wrote: >>... it still objected to `&arr[sizeof arr/sizeof *arr]', >>which is Officially Legal. In article <619.26d6cfb2@iccgcc.decnet.ab.co> browns@iccgcc.decnet.ab.com (Stan Brown, Oak Road Systems) writes: >Just to stick in my $.02: > >int arr[4]; > >sizeof arr/sizeof *arr is 4, so &arr[4] may not be legal. Whether legal or >not, the address is certainly outside the array. See ANSI standard X3.159-1989, section 3.3.6, `additive operators'. (I might have included this before but I was at home.) As I said, it is Officially Legal. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 405 2750) Domain: chris@cs.umd.edu Path: uunet!mimsy!chris