Commit 5326cd3d by Nathan Sidwell Committed by Nathan Sidwell

* c-decl.c: (start_struct): Commonize flag setting.

From-SVN: r59527
parent 0412a4d4
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.
......
......@@ -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. */
ref = make_node (code);
pushtag (name, ref);
}
C_TYPE_BEING_DEFINED (ref) = 1;
TYPE_PACKED (ref) = flag_pack_struct;
return ref;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment