Gentoo Archives: gentoo-dev

From: Georg Rudoy <0xd34df00d@×××××.com>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Changing policy about -Werror
Date: Fri, 14 Sep 2018 00:41:14
Message-Id: 5b9b03a3.1c69fb81.8e7fa.5c8b@mx.google.com
In Reply to: Re: [gentoo-dev] Changing policy about -Werror by Fabian Groffen
1 On 13.09.2018 at 16:20 user Fabian Groffen <grobian@g.o> wrote:
2 >> > To illustrate harmless:
3 >> > warning: this statement may fall through [-Wimplicit-fallthrough=]
4 >> > The warning message already has it in it that it's just a pure guess.
5 >>
6 >> One that exposed a lot of unintentional fallthoughs which were fixed
7 >> when reporting to upstream.
8 >
9 > Sure that's why the warning is there. But you ignore the point that the
10 > same code compiled fine and ran fine for years without problems.
11
12 I have more than a few examples of my code compiling fine and running "fine"
13 for years (so that no observable defects were visible), yet newly introduced
14 warnings or static analyzer runs showed the defects that resolved actual bugs
15 when fixed. And, ironically, that also includes the fallthrough
16 warnings [1-3].
17
18 And cases of me stumbling upon some other legacy code, compiling it with a
19 newer compiler and going "WTF how it even managed to produce anything meaningful
20 at all?" are not uncommon.
21
22 Just my two C++ents here.
23
24 [1] https://github.com/0xd34df00d/leechcraft/commit/663b69249cd61d1cbd490a3eee7909ae26d03240
25 [2] https://github.com/0xd34df00d/leechcraft/commit/fa8ff9dc315e894fada4aaf73534bdfc15121cb3
26 [3] https://github.com/0xd34df00d/leechcraft/commit/6b26961b52b6e8277db39b084f483d1959253313
27
28
29 --
30 Georg Rudoy