summaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 2b484158854..125aa01ad70 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -2088,6 +2088,7 @@ pushdecl (x)
DECL_SOURCE_LINE (IDENTIFIER_IMPLICIT_DECL (name)),
"previous declaration of `%s'",
IDENTIFIER_POINTER (name));
+ TREE_THIS_VOLATILE (name) = 1;
}
if (t != 0 && duplicate_decls (x, t, different_binding_level))
@@ -2291,8 +2292,11 @@ pushdecl (x)
else if (TREE_CODE (x) == TYPE_DECL)
;
else if (IDENTIFIER_IMPLICIT_DECL (name))
- pedwarn ("`%s' was declared implicitly `extern' and later `static'",
- IDENTIFIER_POINTER (name));
+ {
+ if (! TREE_THIS_VOLATILE (name))
+ pedwarn ("`%s' was declared implicitly `extern' and later `static'",
+ IDENTIFIER_POINTER (name));
+ }
else
pedwarn ("`%s' was declared `extern' and later `static'",
IDENTIFIER_POINTER (name));
@@ -4402,9 +4406,10 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
if (type == 0)
{
- if (! (specbits & ((1 << (int) RID_LONG) | (1 << (int) RID_SHORT)
- | (1 << (int) RID_SIGNED)
- | (1 << (int) RID_UNSIGNED))))
+ if ((! (specbits & ((1 << (int) RID_LONG) | (1 << (int) RID_SHORT)
+ | (1 << (int) RID_SIGNED)
+ | (1 << (int) RID_UNSIGNED))))
+ && ! (in_system_header && ! allocation_temporary_p ()))
{
/* C9x will probably require a diagnostic here.
For now, issue a warning if -Wreturn-type and this is a function,