[SLOF] [PATCH] libc: Add missing fallthrough annotation

Thomas Huth thuth at redhat.com
Mon Jan 25 18:01:43 AEDT 2021

On 24/01/2021 09.57, Segher Boessenkool wrote:
> On Sun, Jan 24, 2021 at 07:18:33AM +0100, Thomas Huth wrote:
>> On 24/01/2021 07.00, Alexey Kardashevskiy wrote:
>>> On 23/01/2021 10:34, Segher Boessenkool wrote:
>>>> On Fri, Jan 22, 2021 at 06:24:20PM +0100, Thomas Huth wrote:
>>>>> Is -Wimplicit-fallthrough enabled by default there? Or did you enable it?
>>>> It is enabled by -W (aka -Wextra).  Everyone should always use that
>>>> option (along with -Wall), but I do not know if SLOF does.
>>> SLOF uses -Wall but not -Wextra which produces lot more warnings than this
>>> patch is fixing.
>> I've tried it in a couple of projects already, but IMHO enabling -Wextra is
>> a bad idea.
> It is a lot of work if you enable it on a bigger existing codebase.  It
> is a lot less work if you enable it right from the start.  I recommend
> -Wall -W -Wmissing-declarations -Wformat=2 for all new code.
>> With new versions of GCC, they often added "experimental"
>> warnings with -Wextra which were just wrong in many cases.
> Like?  I don't remember any noisy warnings added to -Wextra in the last
> few years.

It's been quite a while since I made that experience, so I can't remember 
the details (it was likely in the days of GCC 3.x or the early 4.x versions, 
maybe the first incarnation of -Wempty-body or so) and I've been avoiding 
-Wextra since that point in time. Well, maybe it got better in recent years 
and I should give it a try again...


More information about the SLOF mailing list