On Fri, 24 Feb 2017, Jakub Jelinek wrote:

> Hi!
> 
> As mentioned in the PR, -Wformat -Werror=format-security -Wformat
> surprisingly means -Wno-format-security in the end (same effect
> e.g. with -Wall at the end), while
> -Wformat -Wformat-security -Wformat (or -Wall) is -Wformat-security.
> 
> The problem is that all the EnabledBy and LangEnabledBy options
> are changed by the related options only if not explicitly set by the user,
> and for explicit setting by user we mean only those options themselves,
> not some other option that includes it.  In most cases I think that is
> just fine, say for -Wformat -Wformat=2 -Wformat nobody should expect
> -Wformat-security to be on.  But I think -Werror= should, -pedantic-errors
> and -Werror-implicit-function-declaration should be an exception, if
> one uses -Werror=foobar, we should consider -Wfoobar to be set explicitly,
> similarly for -pedantic-errors we should consider -Wpedantic to be set
> explicitly and for -Werror-implicit-function-declaration
> -Wimplicit-function-declaration to be set explicitly.
> 
> So the following patch implements that, pretty much ensures that
> control_warning_option when it calls handle_generated_option ->
> handle_option it will still set_option even in opts_set, not just opts.
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

OK.

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to