From Bugzilla Helper: User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.3-12 alpha) Description of problem: Given the following source code, void f() { int a[ 10]; a[ -1] = -1; /* bug here */ a[ 0] = 0; a[ 9] = 9; a[ 10] = 10; /* bug here */ } then gcc for RH 7.1 fails to find the two bugs in this code. I even tried -ansi -pedantic -Wall, but that didn't help either. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. compile example fragment code. 2. 3. Actual Results: total silence from the compiler. Expected Results: Where an array index is a constant, it might of value to ensure that constant is in range for the array. Additional info:
Please file this as enhancement PR to GCC GNATS instead http://gcc.gnu.org/cgi-bin/gnatsweb.pl?database=gcc