On Sunday 01 April 2018 17:05:13 David Malcolm wrote:
> On Sun, 2018-04-01 at 22:40 +0200, Pali Rohár wrote:
> > On Sunday 01 April 2018 14:32:26 Segher Boessenkool wrote:
> > > On Sun, Apr 01, 2018 at 12:05:40PM +0200, Pali Rohár wrote:
> > > > Command line option -Werror is dangerous as it could cause
> > > > problems for
> > > > compiling applications in future. Once gcc introduces a new
> > > > warning or
> > > > change logic for existing warnings then compilation of existing
> > > > application via gcc could throw a new warning.
> > > > 
> > > > As -Werror makes all warnings fatal, it makes applications not
> > > > compilable. -Werror makes sense only for specific gcc versions
> > > > against
> > > > which was application tested to compile correctly.
> > > > 
> > > > Attached patch adds a new warning when -Werror command line
> > > > option is
> > > > enabled. It warns user that usage of -Werror can be dangerous.
> > > 
> > > While I love this patch in principle...
> > > 
> > > All patches need to be bootstrapped and regression tested.  Did
> > > you?
> > 
> > Yes! Tested and it successfully failed on libgomp bootstrap part.
> > 
> >   cc1: error: command line option ‘-Werror’ is dangerous; in future
> > newly introduced non-fatal warnings can cause fatal errors [-Werror]
> >   cc1: all warnings being treated as errors
> 
> The patch sets:
>   dc->warning_as_error_requested = value;
> before issuing the warning_at, and hence the warning is itself affected
> and treated as an error, making -Werror unusable, and thus forcing
> people to turn it off.

Exactly.

> I'm working on the assumption, based on today's date [1], that this is
> the intended behavior of the patch?  My apologies if I'm
> misunderstanding.

Yes! :-)

But this change is a good for discussion if -Werror should really be
widely used. You can find it in lot of (open source) software. And this
my patch demonstrates that introduction of new warning (not error) or
changing logic when/how is warning throw can be fatal...

I agree with argument that should not be used in release (e.g. enabled
by default in release tarballs).

> Dave
> 
> > > On what target?
> > 
> > x86_64-linux-gnu
> > 
> > > And I think a feature as big as this one isn't suitable for stage
> > > 4.
> > > 
> > > 
> > > Segher
> > 
> > 
> [1] it's been almost 12 hours

-- 
Pali Rohár
pali.ro...@gmail.com

Attachment: signature.asc
Description: PGP signature

Reply via email to