Commit d8e29a65 by Richard Stallman

(attrib): Support attribute `volatile' with alias `noreturn', and `const'.

(stmt): In an expr stmt, call default_conversion for arrays/functions.

From-SVN: r5083
parent 3550617c
...@@ -1063,10 +1063,12 @@ attribute_list ...@@ -1063,10 +1063,12 @@ attribute_list
attrib attrib
: IDENTIFIER : IDENTIFIER
{ if (strcmp (IDENTIFIER_POINTER ($1), "packed")) { if (strcmp (IDENTIFIER_POINTER ($1), "packed")
&& strcmp (IDENTIFIER_POINTER ($1), "noreturn"))
warning ("`%s' attribute directive ignored", warning ("`%s' attribute directive ignored",
IDENTIFIER_POINTER ($1)); IDENTIFIER_POINTER ($1));
$$ = $1; } $$ = $1; }
| TYPE_QUAL
| IDENTIFIER '(' IDENTIFIER ')' | IDENTIFIER '(' IDENTIFIER ')'
{ /* If not "mode (m)", then issue warning. */ { /* If not "mode (m)", then issue warning. */
if (strcmp (IDENTIFIER_POINTER ($1), "mode") != 0) if (strcmp (IDENTIFIER_POINTER ($1), "mode") != 0)
...@@ -1643,6 +1645,11 @@ stmt: ...@@ -1643,6 +1645,11 @@ stmt:
| expr ';' | expr ';'
{ stmt_count++; { stmt_count++;
emit_line_note ($<filename>-1, $<lineno>0); emit_line_note ($<filename>-1, $<lineno>0);
/* Call default_conversion to get an error
on referring to a register array if pedantic. */
if (TREE_CODE (TREE_TYPE ($1)) == ARRAY_TYPE
|| TREE_CODE (TREE_TYPE ($1)) == FUNCTION_TYPE)
$1 = default_conversion ($1);
iterator_expand ($1); iterator_expand ($1);
clear_momentary (); } clear_momentary (); }
| simple_if ELSE | simple_if ELSE
......
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