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
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] [2] [3] -- Georg Rudoy