------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-21 02:44 
-------
Here is the patch if you need it sooner:
Index: c-decl.c
===============================================================
====
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.602
diff -u -p -r1.602 c-decl.c
--- c-decl.c    14 Oct 2004 23:20:57 -0000      1.602
+++ c-decl.c    21 Oct 2004 02:10:02 -0000
@@ -4129,19 +4128,17 @@ grokdeclarator (const struct c_declarato
            if (size_varies)
              C_TYPE_VARIABLE_SIZE (type) = 1;
 
+           /* We can never complete an array type which is the
+              target of a pointer, so go ahead and lay it out.  */
+           layout_type (type);
            /* The GCC extension for zero-length arrays differs from
               ISO flexible array members in that sizeof yields
               zero.  */
            if (size && integer_zerop (size))
              {
-               layout_type (type);
                TYPE_SIZE (type) = bitsize_zero_node;
                TYPE_SIZE_UNIT (type) = size_zero_node;
              }
-           else if (declarator->kind == cdk_pointer)
-             /* We can never complete an array type which is the
-                target of a pointer, so go ahead and lay it out.  */
-             layout_type (type);
 
            if (decl_context != PARM
                && (array_ptr_quals != TYPE_UNQUALIFIED


-- 


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

Reply via email to