This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Array out of bounds warning
- To: Geoff Keating <geoffk at cygnus dot com>
- Subject: Re: Array out of bounds warning
- From: Kamil Iskra <kamil at wins dot uva dot nl>
- Date: Thu, 3 Aug 2000 09:59:17 +0200 (MET DST)
- cc: gcc at gcc dot gnu dot org
On 2 Aug 2000, Geoff Keating wrote:
> > 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?
[snip]
> The behaviour is rendered undefined by the ISO C standard.
Right. Found it. Thanks.
In real-life situations, even if such tricks are used in the code, they
usually involve variable indices, and thus no warning will be generated.
Hence, there shouldn't be a problem.
--
/ 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) /