This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR 5041, zero-length arrays initialized by []; cause gcc-3.0 to segfault
On Fri, Dec 07, 2001 at 04:09:14PM -0500, DJ Delorie wrote:
>
> > they need to be careful to make sure that they don't remove the
> > extension.
>
> And I added some test cases around that time to make sure the old
> extensions now produced errors/warnings; it would be prudent to check
> those with the branch to make sure they *don't* produce any.
Are you talking about:
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.
With gcc 3.0.2, if I compile these test-cases I get:
20000926-1.c:26: warning: deprecated initialization of zero-length array
20000926-1.c:26: warning: (near initialization for `playbook.Play')
array-2.c:10: initialization of flexible array member in a nested context
array-2.c:10: (near initialization for `g2.f.x')
array-2.c:13: warning: deprecated initialization of zero-length array
array-2.c:13: warning: (near initialization for `h1.x')
array-2.c:13: initialization of zero-length array before end of structure
array-2.c:13: (near initialization for `h1.x')
array-4.c:15: warning: deprecated initialization of zero-length array
array-4.c:15: warning: (near initialization for `g.x')
With gcc 3.0-branch, and your patches applied, I get:
20000926-1.c:25: warning: excess elements in array initializer
20000926-1.c:25: warning: (near initialization for `playbook.Play')
array-2.c:10: initialization of flexible array member in a nested context
array-2.c:10: (near initialization for `g2.f.x')
array-2.c:13: warning: excess elements in array initializer
array-2.c:13: warning: (near initialization for `h1.x')
array-4.c:15: warning: excess elements in array initializer
array-4.c:15: warning: (near initialization for `g.x')
array-4.c:15: warning: excess elements in array initializer
array-4.c:15: warning: (near initialization for `g.x')
array-4.c:15: warning: excess elements in array initializer
array-4.c:15: warning: (near initialization for `g.x')
array-4.c:15: warning: excess elements in array initializer
array-4.c:15: warning: (near initialization for `g.x')
--
Craig Rodrigues
http://www.gis.net/~craigr
rodrigc@mediaone.net