Commit 8e077183 by Richard Stallman

(finish_function): If return type of `main' is not `int',

warn instead of doing DEFAULT_MAIN_RETURN.

From-SVN: r1486
parent de86a82e
......@@ -5786,9 +5786,14 @@ finish_function (nested)
#ifdef DEFAULT_MAIN_RETURN
if (! strcmp (IDENTIFIER_POINTER (DECL_NAME (fndecl)), "main"))
{
if (TREE_TYPE (fndecl) != integer_type_node)
warning_with_decl (fndecl, "return type of `%s' is not `int'");
else
{
/* Make it so that `main' always returns success by default. */
DEFAULT_MAIN_RETURN;
}
}
#endif
/* Generate rtl for function exit. */
......
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