[c++] PR 30551 -pedantic does not include -Wmain, but -pedantic-errors does make -Wmain cause error messages
Manuel López-Ibáñez
lopezibanez@gmail.com
Wed Aug 13 16:54:00 GMT 2008
2008/8/12 Joseph S. Myers <joseph@codesourcery.com>:
> On Thu, 7 Aug 2008, Manuel López-Ibáñez wrote:
>
>> 2008-08-04 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
>>
>> PR 30551
>> * 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.
>
>> testsuite/
>> * doc/invoke.texi (Wmain): Update.
>> * 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.
>
> The C parts of the patch (those with log entries above) are OK.
>
PING: http://gcc.gnu.org/ml/gcc-patches/2008-08/msg00435.html
The following changes still need review from C++ maintainer:
cp/
* decl.c (grokfndecl): Call check_main_parameters_type only if -Wmain.
testsuite/
* g++.dg/warn/pr30551.C: New.
* g++.dg/warn/pr30551-2.C: New.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fix-wmain-pr30551.diff
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080813/ec48f965/attachment.ksh>
More information about the Gcc-patches
mailing list