aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1996-04-08 14:44:21 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1996-04-08 14:44:21 -0400
commitcd4aafd57bca02af58e42a8a59bfd571780b28fc (patch)
treeaaa8cc536c82e56306efbea48ff89c19561bc735
parent5ebfb2bafe1d541932739c72fab9feaf70d4e2a9 (diff)
downloadgcc-cd4aafd57bca02af58e42a8a59bfd571780b28fc.zip
gcc-cd4aafd57bca02af58e42a8a59bfd571780b28fc.tar.gz
gcc-cd4aafd57bca02af58e42a8a59bfd571780b28fc.tar.bz2
(finish_function): Always warn if main doesn't return int.
From-SVN: r11674
-rw-r--r--gcc/c-decl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index b737956..6ad09d9 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -6797,19 +6797,19 @@ finish_function (nested)
setjmp_protect_args ();
}
-#ifdef DEFAULT_MAIN_RETURN
if (! strcmp (IDENTIFIER_POINTER (DECL_NAME (fndecl)), "main"))
{
if (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (fndecl)))
!= integer_type_node)
- warning_with_decl (fndecl, "return type of `%s' is not `int'");
+ pedwarn_with_decl (fndecl, "return type of `%s' is not `int'");
else
{
+#ifdef DEFAULT_MAIN_RETURN
/* Make it so that `main' always returns success by default. */
DEFAULT_MAIN_RETURN;
+#endif
}
}
-#endif
/* Generate rtl for function exit. */
expand_function_end (input_filename, lineno, 0);