This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Checking of constant bounds in array access
- To: egcs-bugs at cygnus dot com
- Subject: Checking of constant bounds in array access
- From: Wolfgang Bangerth <wolf at gaia dot iwr dot uni-heidelberg dot de>
- Date: Wed, 1 Jul 1998 14:57:00 +0200 (MET DST)
- Reply-To: Wolfgang Bangerth <wolf at gaia dot iwr dot uni-heidelberg dot de>
Hi there,
this probably has been asked before; if so please excuse, I didn't search
the archives too extensively. My question is: would it be possible for the
compiler to generate a warning on the following code snippet:
----------------------------------------------------------------------
void f() {
int a[10];
a[1000] = 1;
a[-100] = 1;
};
----------------------------------------------------------------------
Bounds and indices are known to the compiler, so it should be possible to
catch this kind of problem.
Regards,
Wolfgang