From 3c9d8bafe27323a6edd9c3c996beacaa36c022f8 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Fri, 24 Dec 1993 07:54:26 -0500 Subject: [PATCH] (check_init_type_bitfields): Check recursively inside arrays and records. From-SVN: r6301 --- gcc/c-typeck.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 28dd281f7e2..155946a004b 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -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, -- 2.30.2