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/testsuite/gcc.dg/pr30551-3.c | |
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/testsuite/gcc.dg/pr30551-3.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/pr30551-3.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr30551-3.c b/gcc/testsuite/gcc.dg/pr30551-3.c new file mode 100644 index 0000000..120d45b --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr30551-3.c @@ -0,0 +1,7 @@ +/* PR 30551 -Wmain is enabled by -pedantic-errors. */ +/* { dg-do compile } */ +/* { dg-options "-pedantic-errors" } */ + +void main(char a) {} /* { dg-error "first argument of .main. should be .int." } */ +/* { dg-error ".main. takes only zero or two arguments" "" { target *-*-* } 5 } */ +/* { dg-error "return type of .main. is not .int." "" { target *-*-* } 5 } */ |