X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fattribs.c;h=7377c57691dfe0b4d91b17965f7201587debe184;hb=7425b151da6157febe70b43e14c5d3947fd4b036;hp=7f43b2af693a32ad3e4969d9a5a624099e637001;hpb=67ce556b47830dd825524e8370969b814c355216;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/attribs.c b/gcc/attribs.c index 7f43b2af693..7377c57691d 100644 --- a/gcc/attribs.c +++ b/gcc/attribs.c @@ -77,21 +77,21 @@ init_attributes (void) /* The name must not begin and end with __. */ const char *name = attribute_tables[i][j].name; int len = strlen (name); - + gcc_assert (!(name[0] == '_' && name[1] == '_' && name[len - 1] == '_' && name[len - 2] == '_')); - + /* The minimum and maximum lengths must be consistent. */ gcc_assert (attribute_tables[i][j].min_length >= 0); - + gcc_assert (attribute_tables[i][j].max_length == -1 || (attribute_tables[i][j].max_length >= attribute_tables[i][j].min_length)); - + /* An attribute cannot require both a DECL and a TYPE. */ gcc_assert (!attribute_tables[i][j].decl_required || !attribute_tables[i][j].type_required); - + /* If an attribute requires a function type, in particular it requires a type. */ gcc_assert (!attribute_tables[i][j].function_type_required @@ -227,8 +227,8 @@ decl_attributes (tree *node, tree attributes, int flags) pull out the target type now, frob it as appropriate, and rebuild the pointer type later. - This would all be simpler if attributes were part of the - declarator, grumble grumble. */ + This would all be simpler if attributes were part of the + declarator, grumble grumble. */ fn_ptr_tmp = TREE_TYPE (*anode); anode = &fn_ptr_tmp; flags &= ~(int) ATTR_FLAG_TYPE_IN_PLACE; @@ -250,6 +250,14 @@ decl_attributes (tree *node, tree attributes, int flags) } } + if (TYPE_P (*anode) + && (flags & (int) ATTR_FLAG_TYPE_IN_PLACE) + && TYPE_SIZE (*anode) != NULL_TREE) + { + warning (OPT_Wattributes, "type attributes ignored after type is already defined"); + continue; + } + if (spec->handler != NULL) returned_attrs = chainon ((*spec->handler) (anode, name, args, flags, &no_add_attrs),