Red Hat Bugzilla – Bug 63891
fails to find obvious bugs
Last modified: 2008-05-01 11:38:02 EDT
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,
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):
Steps to Reproduce:
1. compile example fragment code.
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.
Please file this as enhancement PR to GCC GNATS instead