Somewhat-related changes to expr.c & tree.c

Richard Henderson rth@redhat.com
Sun Nov 19 11:24:00 GMT 2000


On Sun, Nov 19, 2000 at 02:14:43PM -0500, Richard Kenner wrote:
>     So it's as if we wrote array[-1] instead of array[0].
> 
> Yes, but if the array is zero-length, why does that matter?

Geez, can't you be bothered to even glance at the testcase?
Once again, gcc.c-torture/execute/zerolen-1.c.

If you allocate enough contiguous storage following a structure
ending in a zero-length array, you're allowed to dereference it.
This has been a GCC extension for ages, and one that C99 picked up.


r~


More information about the Gcc-patches mailing list