Commit 720283f2 by Richard Kenner

(grokdeclarator): Generate a warning if -Wimplicit, unless a warning

was already generated by -Wreturn-type.

From-SVN: r13135
parent 2f23fcc9
...@@ -4277,10 +4277,20 @@ grokdeclarator (declarator, declspecs, decl_context, initialized) ...@@ -4277,10 +4277,20 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
if (type == 0) if (type == 0)
{ {
if (funcdef_flag && warn_return_type if (! (specbits & ((1 << (int) RID_LONG) | (1 << (int) RID_SHORT)
&& ! (specbits & ((1 << (int) RID_LONG) | (1 << (int) RID_SHORT) | (1 << (int) RID_SIGNED)
| (1 << (int) RID_SIGNED) | (1 << (int) RID_UNSIGNED)))) | (1 << (int) RID_UNSIGNED))))
warn_about_return_type = 1; {
/* C9x will probably require a diagnostic here.
For now, issue a warning if -Wreturn-type and this is a function,
or if -Wimplicit; prefer the former warning since it is more
explicit. */
if ((warn_implicit || warn_return_type) && funcdef_flag)
warn_about_return_type = 1;
else if (warn_implicit)
warning ("type defaults to `int' in declaration of `%s'", name);
}
defaulted_int = 1; defaulted_int = 1;
type = integer_type_node; type = integer_type_node;
} }
......
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