GCC and out-of-range constant array indexes?

Florian Weimer fw@deneb.enyo.de
Sat Oct 9 20:53:00 GMT 2010


* Geert Bosch:

> The Ada front end has very extensive warnings. I don't think
> they really contribute measurably to performance.
> We don't try to construct call graphs to determine
> wether the array reference will be executed or not.
> If the line appears in your program, it will cause an
> error if executed, so we will warn: either you wrote
> dead code, or wrong code.

In other languages, dead code doesn't come not just from the
programmer, but also from the preprocessor and from expansion of
generics (in fact, I've seen misleading warnings involving Ada
generics, too).  So the Ada exprience is not likely to translate to
other front ends.



More information about the Gcc mailing list