On Fri, Aug 09, 2019 at 10:51:09AM -0600, Martin Sebor wrote: > That said, we should change this code one way or the other. > There is even less of a guarantee that other compilers support > writing past the end of arrays that have non-zero size than > that they recognize the documented zero-length extension.
We use that everywhere forever, so no. See e.g. rtx u.fld and u.hwint arrays, tree_exp operands array, gimple_statement_with_ops op array just to name a few that are everywhere. Coverity is indeed unhappy about that, but it would be with [0] certainly too. Another option is to use maximum possible size where we know it (which is the case of rtxes and most tree expressions and gimple stmts, but not e.g. CALL_EXPR or GIMPLE_CALL where there is no easy upper bound. Jakub