From 4003301d719865df5b0f445ab4d80339d86572d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20L=C3=B3pez-Ib=C3=A1=C3=B1ez?= Date: Wed, 13 Aug 2008 17:57:47 +0000 Subject: re PR c/30551 (-pedantic does not include -Wmain, but -pedantic-errors does make -Wmain cause error messages) 2008-08-13 Manuel Lopez-Ibanez PR 30551 * doc/invoke.texi (Wmain): Update. * c-decl.c (start_decl): warn_main is only 0 or 1. (start_function): Likewise. Fix formatting. (finish_function): Delete redundant warning. * c.opt (Wmain): Add Var(warn_main) and Init(-1). * c-opts (c_common_handle_option): -Wall only has effect if warn_main is uninitialized. OPT_Wmain is automatically handled. -pedantic also enables Wmain. (c_common_post_options): Handle all logic for Wmain here. * c-common.c (warn_main): Delete. (check_main_parameter_types): Make pedwarns conditional on OPT_Wmain. * c-common.h (warn_main): Delete. cp/ * decl.c (grokfndecl): Call check_main_parameters_type only if -Wmain. testsuite/ * gcc.dg/pr30551.c: New. * gcc.dg/pr30551-2.c: New. * gcc.dg/pr30551-3.c: New. * gcc.dg/pr30551-4.c: New. * gcc.dg/pr30551-5.c: New. * gcc.dg/pr30551-6.c: New. * gcc.dg/tree-ssa/reassoc-3.c: Don't compile with -pedantic-errors. * g++.dg/warn/pr30551.C: New. * g++.dg/warn/pr30551-2.C: New. From-SVN: r139063 --- gcc/c.opt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/c.opt') diff --git a/gcc/c.opt b/gcc/c.opt index 30782d4..d33fa46 100644 --- a/gcc/c.opt +++ b/gcc/c.opt @@ -281,7 +281,7 @@ C ObjC C++ ObjC++ Var(warn_long_long) Init(1) Warning Do not warn about using \"long long\" when -pedantic Wmain -C ObjC C++ ObjC++ Warning +C ObjC C++ ObjC++ Var(warn_main) Init(-1) Warning Warn about suspicious declarations of \"main\" Wmissing-braces -- cgit v1.1