[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 000/141] Fix fall-through warnings for Clang
- To: Finn Thain <fthain@xxxxxxxxxxxxxxxxxxx>
- From: Miguel Ojeda <miguel.ojeda.sandonis@xxxxxxxxx>
- Date: Mon, 23 Nov 2020 15:05:31 +0100
- Cc: James Bottomley <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>, Kees Cook <keescook@xxxxxxxxxxxx>, Jakub Kicinski <kuba@xxxxxxxxxx>, "Gustavo A. R. Silva" <gustavoars@xxxxxxxxxx>, linux-kernel <linux-kernel@xxxxxxxxxxxxxxx>, alsa-devel@xxxxxxxxxxxxxxxx, amd-gfx@xxxxxxxxxxxxxxxxxxxxx, bridge@xxxxxxxxxxxxxxxxxxxxxxxxxx, ceph-devel@xxxxxxxxxxxxxxx, cluster-devel@xxxxxxxxxx, coreteam@xxxxxxxxxxxxx, devel@xxxxxxxxxxxxxxxxxxxx, dm-devel@xxxxxxxxxx, drbd-dev@xxxxxxxxxxxxxxxx, dri-devel@xxxxxxxxxxxxxxxxxxxxx, GR-everest-linux-l2@xxxxxxxxxxx, GR-Linux-NIC-Dev@xxxxxxxxxxx, intel-gfx@xxxxxxxxxxxxxxxxxxxxx, intel-wired-lan@xxxxxxxxxxxxxxxx, keyrings@xxxxxxxxxxxxxxx, linux1394-devel@xxxxxxxxxxxxxxxxxxxxx, linux-acpi@xxxxxxxxxxxxxxx, linux-afs@xxxxxxxxxxxxxxxxxxx, Linux ARM <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, linux-arm-msm@xxxxxxxxxxxxxxx, linux-atm-general@xxxxxxxxxxxxxxxxxxxxx, linux-block@xxxxxxxxxxxxxxx, linux-can@xxxxxxxxxxxxxxx, linux-cifs@xxxxxxxxxxxxxxx, Linux Crypto Mailing List <linux-crypto@xxxxxxxxxxxxxxx>, linux-decnet-user@xxxxxxxxxxxxxxxxxxxxx, Ext4 Developers List <linux-ext4@xxxxxxxxxxxxxxx>, linux-fbdev@xxxxxxxxxxxxxxx, linux-geode@xxxxxxxxxxxxxxxxxxx, linux-gpio@xxxxxxxxxxxxxxx, linux-hams@xxxxxxxxxxxxxxx, linux-hwmon@xxxxxxxxxxxxxxx, linux-i3c@xxxxxxxxxxxxxxxxxxx, linux-ide@xxxxxxxxxxxxxxx, linux-iio@xxxxxxxxxxxxxxx, linux-input <linux-input@xxxxxxxxxxxxxxx>, linux-integrity@xxxxxxxxxxxxxxx, linux-mediatek@xxxxxxxxxxxxxxxxxxx, Linux Media Mailing List <linux-media@xxxxxxxxxxxxxxx>, linux-mmc@xxxxxxxxxxxxxxx, Linux-MM <linux-mm@xxxxxxxxx>, linux-mtd@xxxxxxxxxxxxxxxxxxx, linux-nfs@xxxxxxxxxxxxxxx, linux-rdma@xxxxxxxxxxxxxxx, linux-renesas-soc@xxxxxxxxxxxxxxx, linux-scsi@xxxxxxxxxxxxxxx, linux-sctp@xxxxxxxxxxxxxxx, linux-security-module@xxxxxxxxxxxxxxx, linux-stm32@xxxxxxxxxxxxxxxxxxxxxxxxxxxx, linux-usb@xxxxxxxxxxxxxxx, linux-watchdog@xxxxxxxxxxxxxxx, linux-wireless <linux-wireless@xxxxxxxxxxxxxxx>, Network Development <netdev@xxxxxxxxxxxxxxx>, netfilter-devel@xxxxxxxxxxxxxxx, nouveau@xxxxxxxxxxxxxxxxxxxxx, op-tee@xxxxxxxxxxxxxxxxxxxxxxxxx, oss-drivers@xxxxxxxxxxxxx, patches@xxxxxxxxxxxxxxxxxxxxx, rds-devel@xxxxxxxxxxxxxx, reiserfs-devel@xxxxxxxxxxxxxxx, samba-technical@xxxxxxxxxxxxxxx, selinux@xxxxxxxxxxxxxxx, target-devel@xxxxxxxxxxxxxxx, tipc-discussion@xxxxxxxxxxxxxxxxxxxxx, usb-storage@xxxxxxxxxxxxxxxxxxxxxxxx, virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx, wcn36xx@xxxxxxxxxxxxxxxxxxx, "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-hardening@xxxxxxxxxxxxxxx, Nick Desaulniers <ndesaulniers@xxxxxxxxxx>, Nathan Chancellor <natechancellor@xxxxxxxxx>, Miguel Ojeda <ojeda@xxxxxxxxxx>, Joe Perches <joe@xxxxxxxxxxx>
- Delivery-date: Mon, 23 Nov 2020 14:05:49 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Sun, Nov 22, 2020 at 11:54 PM Finn Thain <fthain@xxxxxxxxxxxxxxxxxxx> wrote:
>
> We should also take into account optimisim about future improvements in
> tooling.
Not sure what you mean here. There is no reliable way to guess what
the intention was with a missing fallthrough, even if you parsed
whitespace and indentation.
> It is if you want to spin it that way.
How is that a "spin"? It is a fact that we won't get *implicit*
fallthrough mistakes anymore (in particular if we make it a hard
error).
> But what we inevitably get is changes like this:
>
> case 3:
> this();
> + break;
> case 4:
> hmmm();
>
> Why? Mainly to silence the compiler. Also because the patch author argued
> successfully that they had found a theoretical bug, often in mature code.
If someone changes control flow, that is on them. Every kernel
developer knows what `break` does.
> But is anyone keeping score of the regressions? If unreported bugs count,
> what about unreported regressions?
Introducing `fallthrough` does not change semantics. If you are really
keen, you can always compare the objects because the generated code
shouldn't change.
Cheers,
Miguel
|