OSDN Git Service

(check_init_type_bitfields): Check recursively inside arrays and
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 24 Dec 1993 12:54:26 +0000 (12:54 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 24 Dec 1993 12:54:26 +0000 (12:54 +0000)
records.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@6301 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/c-typeck.c

index 28dd281..155946a 100644 (file)
@@ -5200,14 +5200,21 @@ check_init_type_bitfields (type)
       tree tail;
       for (tail = TYPE_FIELDS (type); tail;
           tail = TREE_CHAIN (tail))
-       if (DECL_BIT_FIELD (tail)
-           /* This catches cases like `int foo : 8;'.  */
-           || DECL_MODE (tail) != TYPE_MODE (TREE_TYPE (tail)))
-         {
-           constructor_incremental = 0;
-           break;
-         }
+       {
+         if (DECL_BIT_FIELD (tail)
+             /* This catches cases like `int foo : 8;'.  */
+             || DECL_MODE (tail) != TYPE_MODE (TREE_TYPE (tail)))
+           {
+             constructor_incremental = 0;
+             break;
+           }
+
+         check_init_type_bitfields (TREE_TYPE (tail));
+       }
     }
+
+  else if (TREE_CODE (type) == ARRAY_TYPE)
+    check_init_type_bitfields (TREE_TYPE (type));
 }
 
 /* At the end of an implicit or explicit brace level,