diff options
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/c-decl.c | 21 |
2 files changed, 13 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6865d58..c44e14c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2002-11-26 Nathan Sidwell <nathan@codesourcery.com> + + * c-decl.c: (start_struct): Commonize flag setting. + 2002-11-26 Jason Thorpe <thorpej@wasabisystems.com> * config/rs6000/rs6000.h (RS6000_CPU_CPP_ENDIAN_BUILTINS): New. diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 5b078c0..ef4840a 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -4954,25 +4954,22 @@ start_struct (code, name) ref = lookup_tag (code, name, current_binding_level, 1); if (ref && TREE_CODE (ref) == code) { - C_TYPE_BEING_DEFINED (ref) = 1; - TYPE_PACKED (ref) = flag_pack_struct; if (TYPE_FIELDS (ref)) { if (code == UNION_TYPE) - error ("redefinition of `union %s'", - IDENTIFIER_POINTER (name)); + error ("redefinition of `union %s'", IDENTIFIER_POINTER (name)); else - error ("redefinition of `struct %s'", - IDENTIFIER_POINTER (name)); + error ("redefinition of `struct %s'", IDENTIFIER_POINTER (name)); } - - return ref; } + else + { + /* Otherwise create a forward-reference just so the tag is in scope. */ - /* Otherwise create a forward-reference just so the tag is in scope. */ - - ref = make_node (code); - pushtag (name, ref); + ref = make_node (code); + pushtag (name, ref); + } + C_TYPE_BEING_DEFINED (ref) = 1; TYPE_PACKED (ref) = flag_pack_struct; return ref; |