PR 5041, zero-length arrays initialized by []; cause gcc-3.0 to segfault

DJ Delorie dj@redhat.com
Fri Dec 7 14:29:00 GMT 2001


> 2001-09-20  DJ Delorie  <dj@redhat.com>
>  
>         * gcc.dg/20000926-1.c: Update expected warning messages.
>         * gcc.dg/array-2.c: Likewise, and test for warnings too.
>         * gcc.dg/array-4.c: Likewise, and don't verify the zero-length        array.

Yup.

> With gcc 3.0.2, if I compile these test-cases I get:
> 20000926-1.c:26: warning: deprecated initialization of zero-length array
> 
> With gcc 3.0-branch, and your patches applied, I get:
> 20000926-1.c:25: warning: excess elements in array initializer

See?  My patch removed the "deprecated" warning, so it shouldn't be
applied as-is.  The new wording is only appropriate for 3.1, where a
zero-length array *is* zero-length, not for 3.0 where a zero-length
array is actually variable length.



More information about the Gcc-patches mailing list