[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 000/141] Fix fall-through warnings for Clang
- To: Miguel Ojeda <miguel.ojeda.sandonis@xxxxxxxxx>
- From: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
- Date: Thu, 26 Nov 2020 16:28:12 +0100
- Cc: Edward Cree <ecree.xilinx@xxxxxxxxx>, ALSA Development Mailing List <alsa-devel@xxxxxxxxxxxxxxxx>, linux-atm-general@xxxxxxxxxxxxxxxxxxxxx, reiserfs-devel@xxxxxxxxxxxxxxx, linux-iio@xxxxxxxxxxxxxxx, linux-wireless <linux-wireless@xxxxxxxxxxxxxxx>, Linux Fbdev development list <linux-fbdev@xxxxxxxxxxxxxxx>, dri-devel <dri-devel@xxxxxxxxxxxxxxxxxxxxx>, "Gustavo A. R. Silva" <gustavoars@xxxxxxxxxx>, James Bottomley <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>, linux-ide@xxxxxxxxxxxxxxx, dm-devel@xxxxxxxxxx, keyrings@xxxxxxxxxxxxxxx, MTD Maling List <linux-mtd@xxxxxxxxxxxxxxxxxxx>, GR-everest-linux-l2@xxxxxxxxxxx, wcn36xx@xxxxxxxxxxxxxxxxxxx, samba-technical@xxxxxxxxxxxxxxx, linux-i3c@xxxxxxxxxxxxxxxxxxx, linux1394-devel@xxxxxxxxxxxxxxxxxxxxx, linux-afs@xxxxxxxxxxxxxxxxxxx, usb-storage@xxxxxxxxxxxxxxxxxxxxxxxx, Lars Ellenberg <drbd-dev@xxxxxxxxxxxxxxxx>, driverdevel <devel@xxxxxxxxxxxxxxxxxxxx>, linux-cifs@xxxxxxxxxxxxxxx, rds-devel@xxxxxxxxxxxxxx, Nick Desaulniers <ndesaulniers@xxxxxxxxxx>, scsi <linux-scsi@xxxxxxxxxxxxxxx>, Nathan Chancellor <natechancellor@xxxxxxxxx>, linux-rdma <linux-rdma@xxxxxxxxxxxxxxx>, oss-drivers@xxxxxxxxxxxxx, bridge@xxxxxxxxxxxxxxxxxxxxxxxxxx, linux-security-module <linux-security-module@xxxxxxxxxxxxxxx>, amd-gfx list <amd-gfx@xxxxxxxxxxxxxxxxxxxxx>, linux-stm32@xxxxxxxxxxxxxxxxxxxxxxxxxxxx, cluster-devel@xxxxxxxxxx, ACPI Devel Maling List <linux-acpi@xxxxxxxxxxxxxxx>, coreteam@xxxxxxxxxxxxx, intel-wired-lan@xxxxxxxxxxxxxxxx, linux-input <linux-input@xxxxxxxxxxxxxxx>, Miguel Ojeda <ojeda@xxxxxxxxxx>, Jakub Kicinski <kuba@xxxxxxxxxx>, Ext4 Developers List <linux-ext4@xxxxxxxxxxxxxxx>, Linux Media Mailing List <linux-media@xxxxxxxxxxxxxxx>, Kees Cook <keescook@xxxxxxxxxxxx>, selinux@xxxxxxxxxxxxxxx, linux-arm-msm <linux-arm-msm@xxxxxxxxxxxxxxx>, Intel Graphics Development <intel-gfx@xxxxxxxxxxxxxxxxxxxxx>, linux-geode@xxxxxxxxxxxxxxxxxxx, linux-can@xxxxxxxxxxxxxxx, linux-block@xxxxxxxxxxxxxxx, "open list:GPIO SUBSYSTEM" <linux-gpio@xxxxxxxxxxxxxxx>, op-tee@xxxxxxxxxxxxxxxxxxxxxxxxx, linux-mediatek@xxxxxxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, Nouveau Dev <nouveau@xxxxxxxxxxxxxxxxxxxxx>, linux-hams@xxxxxxxxxxxxxxx, ceph-devel <ceph-devel@xxxxxxxxxxxxxxx>, virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx, Linux ARM <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, linux-hwmon@xxxxxxxxxxxxxxx, Linux Watchdog Mailing List <linux-watchdog@xxxxxxxxxxxxxxx>, "open list:NFS, SUNRPC, AND..." <linux-nfs@xxxxxxxxxxxxxxx>, GR-Linux-NIC-Dev@xxxxxxxxxxx, tipc-discussion@xxxxxxxxxxxxxxxxxxxxx, Linux-MM <linux-mm@xxxxxxxxx>, Network Development <netdev@xxxxxxxxxxxxxxx>, linux-decnet-user@xxxxxxxxxxxxxxxxxxxxx, Linux MMC List <linux-mmc@xxxxxxxxxxxxxxx>, linux-kernel <linux-kernel@xxxxxxxxxxxxxxx>, "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@xxxxxxxxxx>, Linux-Renesas <linux-renesas-soc@xxxxxxxxxxxxxxx>, linux-sctp@xxxxxxxxxxxxxxx, USB list <linux-usb@xxxxxxxxxxxxxxx>, NetFilter <netfilter-devel@xxxxxxxxxxxxxxx>, Linux Crypto Mailing List <linux-crypto@xxxxxxxxxxxxxxx>, patches@xxxxxxxxxxxxxxxxxxxxx, Joe Perches <joe@xxxxxxxxxxx>, linux-integrity <linux-integrity@xxxxxxxxxxxxxxx>, target-devel <target-devel@xxxxxxxxxxxxxxx>, linux-hardening@xxxxxxxxxxxxxxx
- Delivery-date: Thu, 26 Nov 2020 15:28:32 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
Hi Miguel,
On Thu, Nov 26, 2020 at 3:54 PM Miguel Ojeda
<miguel.ojeda.sandonis@xxxxxxxxx> wrote:
> On Wed, Nov 25, 2020 at 11:44 PM Edward Cree <ecree.xilinx@xxxxxxxxx> wrote:
> > To make the intent clear, you have to first be certain that you
> > understand the intent; otherwise by adding either a break or a
> > fallthrough to suppress the warning you are just destroying the
> > information that "the intent of this code is unknown".
>
> If you don't know what the intent of your own code is, then you
> *already* have a problem in your hands.
The maintainer is not necessarily the owner/author of the code, and
thus may not know the intent of the code.
> > or does it flag up code
> > that can be mindlessly "fixed" (in which case the warning is
> > worthless)? Proponents in this thread seem to be trying to
> > have it both ways.
>
> A warning is not worthless just because you can mindlessly fix it.
> There are many counterexamples, e.g. many
> checkpatch/lint/lang-format/indentation warnings, functional ones like
> the `if (a = b)` warning...
BTW, you cannot mindlessly fix the latter, as you cannot know if
"(a == b)" or "((a = b))" was intended, without understanding the code
(and the (possibly unavailable) data sheet, and the hardware, ...).
P.S. So far I've stayed out of this thread, as I like it if the compiler
flags possible mistakes. After all I was the one fixing new
"may be used uninitialized" warnings thrown up by gcc-4.1, until
(a bit later than) support for that compiler was removed...
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
|