Gentoo Archives: gentoo-dev

From: Matt Turner <mattst88@g.o>
To: gentoo development <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] Changing policy about -Werror
Date: Thu, 13 Sep 2018 23:21:38
Message-Id: CAEdQ38G7jmwFz8HDSZQQqzHvtmUX2nR0-w+LTT_PX5m6NBV=tQ@mail.gmail.com
In Reply to: Re: [gentoo-dev] Changing policy about -Werror by Richard Yao
1 On Thu, Sep 13, 2018 at 4:13 PM Richard Yao <ryao@g.o> wrote:
2 > > On Sep 13, 2018, at 12:03 PM, Fabian Groffen <grobian@g.o> wrote:
3 > >
4 > >> On 13-09-2018 07:36:09 -0400, Richard Yao wrote:
5 > >>
6 > >>
7 > >>>> On Sep 12, 2018, at 6:55 PM, Thomas Deutschmann <whissi@g.o> wrote:
8 > >>>>
9 > >>>> On 2018-09-12 16:50, Rich Freeman wrote:
10 > >>>> There is also the case where we want these warnings to block
11 > >>>> installation, because the risk of there being a problem is too great.
12 > >>>
13 > >>> I really disagree with that. So many devs have already said multiple
14 > >>> times in this thread that "-Werror" is only turning existing warnings
15 > >>> into fatal errors but "-Werror" itself doesn't add any new checks and
16 > >>> more often requires "-O3" to be useful.
17 > >> 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.
18 > >
19 > > Huh? -O3 enables more checks, which can generate more warnings.
20 >
21 > 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.
22
23 https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
24
25 Search for "depend on"
26
27 -> [...] estimated based on heuristics that depend on thelevel
28 argument and on optimization
29
30 -> Because these warnings depend on optimization [...]
31
32 Yes, warnings are dependent on optimization level.

Replies

Subject Author
Re: [gentoo-dev] Changing policy about -Werror Richard Yao <ryao@g.o>