diff options
author | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2008-08-13 17:57:47 +0000 |
---|---|---|
committer | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2008-08-13 17:57:47 +0000 |
commit | 4003301d719865df5b0f445ab4d80339d86572d7 (patch) | |
tree | d1fe225e6b0637a6333ddd4ed28cd99d4d43c234 /gcc/c.opt | |
parent | 6cd7942d77ea3017ce217daf9621fadc35fe8f8f (diff) | |
download | gcc-4003301d719865df5b0f445ab4d80339d86572d7.zip gcc-4003301d719865df5b0f445ab4d80339d86572d7.tar.gz gcc-4003301d719865df5b0f445ab4d80339d86572d7.tar.bz2 |
re PR c/30551 (-pedantic does not include -Wmain, but -pedantic-errors does make -Wmain cause error messages)
2008-08-13 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
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
Diffstat (limited to 'gcc/c.opt')
-rw-r--r-- | gcc/c.opt | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 |