From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kamil Iskra To: Jeffrey A Law Cc: Falk Hueffner , gcc@gcc.gnu.org Subject: Re: Array out of bounds warning Date: Wed, 02 Aug 2000 14:59:00 -0000 Message-id: References: <15088.965052644@upchuck> X-SW-Source: 2000-08/msg00046.html On Mon, 31 Jul 2000, Jeffrey A Law wrote: > > int a[10]; > > a[10] = 17; [snip] > The next question in my mind is how often do we get false hits on the > warning. I've been wondering: what will the proposed patch do for n-dimensional arrays, say: int a[10][10]; a[0][10]=17; I think right now the code will generate a warning, but is this what we want? I'm not entirely sure whether the standard does allow such a construction, but surely it has a well defined meaning, given that the memory layout of arrays is precisely defined in the standard. I've seen such a code only yesterday, where it was used for speed reasons, so it's probably not an uncommon trick. Regards, -- / Kamil Iskra kamil@wins.uva.nl \ | Section Computational Science, Faculty FNWI, Universiteit van Amsterdam | | tel. +31 20 525 75 35 fax. +31 20 525 74 90 | \ Kruislaan 403 room F.202 1098 SJ Amsterdam (NL) /