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

warn instead of doing DEFAULT_MAIN_RETURN.

From-SVN: r1486
This commit is contained in:
Richard Stallman 1992-07-07 01:09:25 +00:00
parent de86a82eca
commit 8e077183b4

View File

@ -5786,8 +5786,13 @@ finish_function (nested)
#ifdef DEFAULT_MAIN_RETURN
if (! strcmp (IDENTIFIER_POINTER (DECL_NAME (fndecl)), "main"))
{
/* Make it so that `main' always returns success by default. */
DEFAULT_MAIN_RETURN;
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