On 27 March 2017 at 14:49, Steve Kargl wrote: > On Mon, Mar 27, 2017 at 02:36:27PM +0100, Jonathan Wakely wrote: >> On 27 March 2017 at 14:26, Steve Kargl wrote: >> > I completely disagree with your viewpoint here. If someone turns >> > on a silly warning, that someone should fix all places within the >> > tree that triggers that warning. There is ZERO value to this warning, >> > but added work for others to clean up that someone's mess. >> >> Your absolutist view is just an opinion and reasonable people disagree >> on the value of the warning. It's already found bugs in real code. >> >> You could continue being upset, or somebody who understands the code >> could just fix the warnings and everybody can get on with their lives. > > Go scan the gcc-patches mailing list for "fallthrough". I'll > note other have concerns. Here's one example: > > https://gcc.gnu.org/ml/gcc-patches/2016-11/msg00300.html > > Without Bernd's patch to set the default to 1 you will drown > in false positives once you start using gcc-7 to build a whole > distro. On my Gentoo test box anything but level 1 is simply > unacceptable, because you will miss important other warnings > in the -Wimplicit-fallthrough noise otherwise. > > The code is valid C. So, you'll fixing already valid code.
That's the case for many of GCC's warnings, as you are surely aware. Please re-read the documentation for -Wall: This enables all the warnings about constructions that some users consider questionable, and that are easy to avoid (or modify to prevent the warning), even in conjunction with macros. [...] Note that some warning flags are not implied by -Wall. Some of them warn about constructions that users generally do not consider questionable, but which occasionally you might wish to check for; others warn about constructions that are necessary or hard to avoid in some cases, and there is no simple way to modify the code to suppress the warning. Some of them are enabled by -Wextra but many of them must be enabled individually. -Wimplicit-fallthrough is in the latter category, despite it being easy to modify the code to avoid the warning.