aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/c-decl.c2
-rw-r--r--gcc/c/c-parser.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c
index 4b5481c..516e3c2 100644
--- a/gcc/c/c-decl.c
+++ b/gcc/c/c-decl.c
@@ -4643,7 +4643,7 @@ c_warn_unused_attributes (tree attrs)
constraint violation. */
pedwarn (input_location, OPT_Wattributes, "%qE attribute ignored",
get_attribute_name (t));
- else
+ else if (!attribute_ignored_p (t))
warning (OPT_Wattributes, "%qE attribute ignored",
get_attribute_name (t));
}
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index d7e5f05..b09ad30 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -4943,7 +4943,9 @@ c_parser_std_attribute (c_parser *parser, bool for_tm)
parens.skip_until_found_close (parser);
return error_mark_node;
}
- if (as)
+ /* If this is a fake attribute created to handle -Wno-attributes,
+ we must skip parsing the arguments. */
+ if (as && !attribute_ignored_p (as))
{
bool takes_identifier
= (ns != NULL_TREE