On Tue, Oct 06, 2020 at 10:42:12AM -0600, Martin Sebor wrote:
> The manual documents the [0] extension and mentions but discourages
> using [1].  Nothing is said about other sizes and the warnings such
> as -Warray-bounds have been increasingly complaining about accesses
> past the declared constant bound (it won't complain about past-
> the-end accesses to a mem[1], but will about those to mem[2]).
> 
> It would be nice if existing GCC code could eventually be converted
> to avoid relying on the [1] hack.  I would hope we would avoid making
> use of it in new code (and certainly avoid extending its uses to other
> sizes).

I don't see how we could, because [0] is an extension and GCC needs to
support host compilers that don't support it, and similarly [] is an
extension in C++ and can't be relied on.
Changing say rtl or gimple structs from the way we define them currently
to say templates dependent on the size of the embedded arrays is I'm
afraid not really possible.

        Jakub

Reply via email to