https://bugzilla.novell.com/show_bug.cgi?id=242277 Summary: gcc: improved array index checking at run time Product: openSUSE 10.3 Version: unspecified Platform: All OS/Version: SuSE Other Status: NEW Severity: Enhancement Priority: P5 - None Component: Development AssignedTo: pth@novell.com ReportedBy: dcb314@hotmail.com QAContact: qa@suse.de Currently, gcc has no mode to check array indexes for sanity at run time. Suggest add a new compiler flag [ -fdebug ? ], which causes extra code to be generated at run time to check that the value of an array index is valid. If the array index in invalid, suggest stop the program with a suitable error message, including __FILE__ and __LINE__. So by example, int array[ 10]; void g( int); void f( int upperLimit) { for (int i = 0; i < upperLimit; ++i) { g( array[ i]); } } called by /* ... */ limit = 20; /* ... */ f( limit); then the program would stop at run time with error message Program a.out: bad array index 10 at line 1234 in file abcdef.c -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.