[Bug c/56078] causes cc1 to crash

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jan 24 13:33:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56078

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-01-24 13:33:13 UTC ---
Before my patch we got:
20030305-1.c:15:5: warning: excess elements in struct initializer [enabled by
default]
20030305-1.c:15:5: warning: (near initialization for ‘s2_array[0]’) [enabled by
default]
20030305-1.c:16:5: warning: excess elements in struct initializer [enabled by
default]
20030305-1.c:16:5: warning: (near initialization for ‘s2_array[1]’) [enabled by
default]
20030305-1.c:17:5: warning: excess elements in struct initializer [enabled by
default]
20030305-1.c:17:5: warning: (near initialization for ‘s2_array[2]’) [enabled by
default]
and with the patch:
20030305-1.c:15:5: error: initialization of flexible array member in a nested
context
20030305-1.c:15:5: error: (near initialization for ‘s2_array[0].s1_array’)
20030305-1.c:16:5: error: initialization of flexible array member in a nested
context
20030305-1.c:16:5: error: (near initialization for ‘s2_array[1].s1_array’)
20030305-1.c:17:5: error: initialization of flexible array member in a nested
context
20030305-1.c:17:5: error: (near initialization for ‘s2_array[2].s1_array’)
instead.

I'd lean towards the errors being correct, Joseph, do you agree?  If so, I'll
move the 20030305-1.c testcase into gcc.dg and add dg-error comments.



More information about the Gcc-bugs mailing list