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
On 13.09.2018 at 16:20 user Fabian Groffen <grobian@g.o> wrote:
>> > To illustrate harmless: >> > warning: this statement may fall through [-Wimplicit-fallthrough=] >> > The warning message already has it in it that it's just a pure guess. >> >> One that exposed a lot of unintentional fallthoughs which were fixed >> when reporting to upstream. > > Sure that's why the warning is there. But you ignore the point that the > same code compiled fine and ran fine for years without problems.
I have more than a few examples of my code compiling fine and running "fine" for years (so that no observable defects were visible), yet newly introduced warnings or static analyzer runs showed the defects that resolved actual bugs when fixed. And, ironically, that also includes the fallthrough warnings [1-3]. And cases of me stumbling upon some other legacy code, compiling it with a newer compiler and going "WTF how it even managed to produce anything meaningful at all?" are not uncommon. Just my two C++ents here. [1] https://github.com/0xd34df00d/leechcraft/commit/663b69249cd61d1cbd490a3eee7909ae26d03240 [2] https://github.com/0xd34df00d/leechcraft/commit/fa8ff9dc315e894fada4aaf73534bdfc15121cb3 [3] https://github.com/0xd34df00d/leechcraft/commit/6b26961b52b6e8277db39b084f483d1959253313 -- Georg Rudoy