diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1993-12-24 07:54:26 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1993-12-24 07:54:26 -0500 |
commit | 3c9d8bafe27323a6edd9c3c996beacaa36c022f8 (patch) | |
tree | 0a5d9436fccee4a6f01fd6263d5f8c8bc86cad46 /gcc | |
parent | 6f38f669d08474e8396c13c5566c46af6e66a47a (diff) | |
download | gcc-3c9d8bafe27323a6edd9c3c996beacaa36c022f8.zip gcc-3c9d8bafe27323a6edd9c3c996beacaa36c022f8.tar.gz gcc-3c9d8bafe27323a6edd9c3c996beacaa36c022f8.tar.bz2 |
(check_init_type_bitfields): Check recursively inside arrays and
records.
From-SVN: r6301
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-typeck.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 28dd281..155946a 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, |