This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Should a disabled warning be allowed to be promoted to an error(Bugzilla PR 70275)?
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Florian Weimer <fw at deneb dot enyo dot de>
- Cc: Martin Sebor <msebor at gmail dot com>, kevin-tucker at cox dot net, gcc at gcc dot gnu dot org, dodji at redhat dot com, dmalcolm at redhat dot com
- Date: Thu, 31 Mar 2016 12:03:51 -0500
- Subject: Re: Should a disabled warning be allowed to be promoted to an error(Bugzilla PR 70275)?
- Authentication-results: sourceware.org; auth=none
- References: <20160328142309 dot CKMHR dot 556080 dot imail at eastrmwml106> <87r3eul6ki dot fsf at mid dot deneb dot enyo dot de> <56F9B112 dot 6080704 at gmail dot com> <20160331163036 dot GA20004 at gate dot crashing dot org> <87zitemwsb dot fsf at mid dot deneb dot enyo dot de>
On Thu, Mar 31, 2016 at 06:34:12PM +0200, Florian Weimer wrote:
> * Segher Boessenkool:
>
> > On Mon, Mar 28, 2016 at 04:32:50PM -0600, Martin Sebor wrote:
> >> On 03/28/2016 01:56 PM, Florian Weimer wrote:
> >> >>In Bugzilla PR # 70275, Manuel López-Ibáñez reports that even though
> >> >>he provides the "-Werror=return-type" option, the compiler doesn't
> >> >>flag the warning/error about a control reaching the end of a non-void
> >> >>function, due to the presence of the "-w" option. He points out that
> >> >>clang++ wtill flags the promoted warning even though warnings are
> >> >>inhibited.
> >> >
> >> >I think -w is ordered with respect to the other warning obtions, and
> >> >-w inhibits previously requested warnings, and future -W flags may
> >> >enable other warnings. With this in mind, I agree that the current
> >> >GCC behavior is consistent and probably not a bug.
> >>
> >> The general rule of thumb documented in the manual is that more
> >> specific options take precedence over more general ones, regardless
> >> of where they appear on the command line:
> >
> > Currently, -w is a nice easy quick way of shutting up all warnings
> > whenever they are getting in the way. Let's keep it that way.
>
> You mean, by putting -w towards the end of the command line?
Either that or how it is now (always turn off everything, wherever -w is
on the command line); but certainly not "more specific overrides less
specific". -w turns off all warnings, it's a very useful feature.
Segher