diff options
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c-typeck.c | 17 |
2 files changed, 22 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d708c5dc197..d921095717b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +Wed Jul 14 23:45:48 1999 J"orn Rennecke <amylaar@cygnus.co.uk> + + * c-typeck.c (output_init_element, process_init_element): + When advancing constructor_unfilled_fields for a RECORD_TYPE, + check for nameless bit fields. + Wed Jul 14 01:57:39 1999 Richard Henderson <rth@cygnus.com> * regclass.c (scan_one_insn): Notice subregs that change the diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index d4749cda234..18b82109ed5 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -6150,7 +6150,16 @@ output_init_element (value, type, field, pending) = TREE_INT_CST_HIGH (tem); } else if (TREE_CODE (constructor_type) == RECORD_TYPE) - constructor_unfilled_fields = TREE_CHAIN (constructor_unfilled_fields); + { + constructor_unfilled_fields = + TREE_CHAIN (constructor_unfilled_fields); + /* Skip any nameless bit fields. */ + while (constructor_unfilled_fields != 0 + && DECL_C_BIT_FIELD (constructor_unfilled_fields) + && DECL_NAME (constructor_unfilled_fields) == 0) + constructor_unfilled_fields = + TREE_CHAIN (constructor_unfilled_fields); + } else if (TREE_CODE (constructor_type) == UNION_TYPE) constructor_unfilled_fields = 0; @@ -6485,6 +6494,12 @@ process_init_element (value) = TREE_INT_CST_HIGH (temp); constructor_unfilled_fields = TREE_CHAIN (constructor_fields); + /* Skip any nameless bit fields. */ + while (constructor_unfilled_fields != 0 + && DECL_C_BIT_FIELD (constructor_unfilled_fields) + && DECL_NAME (constructor_unfilled_fields) == 0) + constructor_unfilled_fields = + TREE_CHAIN (constructor_unfilled_fields); } constructor_fields = TREE_CHAIN (constructor_fields); |