GCC and out-of-range constant array indexes?

Ian Lance Taylor iant@google.com
Fri Oct 8 17:37:00 GMT 2010


Gary Funck <gary@intrepid.com> writes:

>> There was an attempt a couple of years ago to implement this warning
>> when not optimizing [...].
>
> Would it be possible to compute enough of the control flow graph
> to process warnings like this one, without running the
> actual optimizations, unless those optimizations are requested?
> Would the cost be too high?

I think it could be done but I don't think it would be simple.  I do
think it would be a good idea to make warnings independent of
optimization level, except for those warnings like -Wstrict-aliasing
which are specifically about optimizations.

Ian



More information about the Gcc mailing list