This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: FDO usage: -Wcoverage-mismatch should not ignore -Wno-error
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Xinliang David Li <davidxl at google dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jan Hubicka <hubicka at ucw dot cz>, Neil Vachharajani <nvachhar at gmail dot com>
- Date: Thu, 21 Apr 2011 19:54:03 +0000 (UTC)
- Subject: Re: FDO usage: -Wcoverage-mismatch should not ignore -Wno-error
- References: <BANLkTi=-QuDzrCzA7JjZj8uPs+CGa0GRBA@mail.gmail.com>
On Tue, 19 Apr 2011, Xinliang David Li wrote:
> 2011-04-18 Neil Vachharajani <nvachhar@gmail.com>
>
> * flags.c: New flag variable.
> * opts.c (common_handle_options): Set flag_werror_set.
> * opts-global.c (decode_options): Delay Werror decision
> for Wcoverage-mismatch util after options are parsed.
This patch is certainly wrong, since common_handle_option must not set any
global state, only state pointed to by its arguments.
That said, setting -Werror=coverage-mismatch in decode_options at all is
bad because decode_options is called when optimize attributes are
processed; as-is, a -Wno-error=coverage-mismatch option will be overridden
if such attributes are used.
So the right place to set this is probably later, in process_options. And
this can check global_options_set.x_warnings_are_errors to see if an
explicit -Werror/-Wno-error option was passed.
--
Joseph S. Myers
joseph@codesourcery.com