Gentoo Archives: gentoo-dev

From: Richard Yao <ryao@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Changing policy about -Werror
Date: Thu, 13 Sep 2018 23:13:04
Message-Id: 4FCF42AC-6B48-40F6-8B98-79CF71789A6A@gentoo.org
In Reply to: Re: [gentoo-dev] Changing policy about -Werror by Fabian Groffen
1 > On Sep 13, 2018, at 12:03 PM, Fabian Groffen <grobian@g.o> wrote:
2 >
3 >> On 13-09-2018 07:36:09 -0400, Richard Yao wrote:
4 >>
5 >>
6 >>>> On Sep 12, 2018, at 6:55 PM, Thomas Deutschmann <whissi@g.o> wrote:
7 >>>>
8 >>>> On 2018-09-12 16:50, Rich Freeman wrote:
9 >>>> There is also the case where we want these warnings to block
10 >>>> installation, because the risk of there being a problem is too great.
11 >>>
12 >>> I really disagree with that. So many devs have already said multiple
13 >>> times in this thread that "-Werror" is only turning existing warnings
14 >>> into fatal errors but "-Werror" itself doesn't add any new checks and
15 >>> more often requires "-O3" to be useful.
16 >> The way that compilers work is that the warnings are generated in the front end while the optimization level affects the backend. That means that -O3 has no effect on the code that does error generation. This remark about -O3 being needed to make -Werror useful is just plain wrong.
17 >
18 > Huh? -O3 enables more checks, which can generate more warnings.
19
20 What checks are those? -O3 affects backend optimization while warnings are generated by the front end. Once the immediate representation is generated, there are no other warnings aside from those from the linker.
21 > -O3
22 > isn't "needed", but if upstream is so interested in clean and correct
23 > code, they should've fixed all warnings in the first place and thus
24 > enabled all of them. In fact, I expect every sane upstream to use "-O3
25 > -Wall -Werror" in one of their automated builds. Not that this catches
26 > anything useful on x86{,_64} when there is for instance use of signed
27 > and unsigned char types, so it isn't conclusive.
28 >
29 > The whole point in here is that -Werror doesn't add much if you care.
30 > The whole point why it is not desired in Gentoo is that users don't
31 > necessarily are developers, or even interested in fixing warnings --
32 > regardless whether they point to real problems or not.
33 >
34 > If there are real problems in a package (exposed by a compiler or not)
35 > then this should ideally stand out during ~arch testing, or even before
36 > when the Gentoo maintainer examines the build (might even use -Werror
37 > for his own purposes). If such code ends up in stable arch we just made
38 > a stabilisation mistake, or got royally messed up by upstream, depending
39 > how you look at it.
40 >
41 > Fabian
42 >
43 > --
44 > Fabian Groffen
45 > Gentoo on a different level

Replies

Subject Author
Re: [gentoo-dev] Changing policy about -Werror Matt Turner <mattst88@g.o>