[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 000/141] Fix fall-through warnings for Clang
- To: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
- From: Karol Herbst <kherbst@xxxxxxxxxx>
- Date: Thu, 26 Nov 2020 17:18:13 +0100
- Authentication-results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kherbst@xxxxxxxxxx
- Cc: Miguel Ojeda <miguel.ojeda.sandonis@xxxxxxxxx>, ALSA Development Mailing List <alsa-devel@xxxxxxxxxxxxxxxx>, bridge@xxxxxxxxxxxxxxxxxxxxxxxxxx, target-devel <target-devel@xxxxxxxxxxxxxxx>, linux-iio@xxxxxxxxxxxxxxx, linux-wireless <linux-wireless@xxxxxxxxxxxxxxx>, Linux MMC List <linux-mmc@xxxxxxxxxxxxxxx>, Linux Fbdev development list <linux-fbdev@xxxxxxxxxxxxxxx>, dri-devel <dri-devel@xxxxxxxxxxxxxxxxxxxxx>, virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx, 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, linux-i3c@xxxxxxxxxxxxxxxxxxx, linux1394-devel@xxxxxxxxxxxxxxxxxxxxx, linux-afs@xxxxxxxxxxxxxxxxxxx, Lars Ellenberg <drbd-dev@xxxxxxxxxxxxxxxx>, driverdevel <devel@xxxxxxxxxxxxxxxxxxxx>, linux-cifs@xxxxxxxxxxxxxxx, rds-devel@xxxxxxxxxxxxxx, scsi <linux-scsi@xxxxxxxxxxxxxxx>, ACPI Devel Maling List <linux-acpi@xxxxxxxxxxxxxxx>, linux-rdma <linux-rdma@xxxxxxxxxxxxxxx>, oss-drivers@xxxxxxxxxxxxx, linux-atm-general@xxxxxxxxxxxxxxxxxxxxx, ceph-devel <ceph-devel@xxxxxxxxxxxxxxx>, amd-gfx list <amd-gfx@xxxxxxxxxxxxxxxxxxxxx>, linux-stm32@xxxxxxxxxxxxxxxxxxxxxxxxxxxx, cluster-devel@xxxxxxxxxx, usb-storage@xxxxxxxxxxxxxxxxxxxxxxxx, 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>, NetFilter <netfilter-devel@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-sctp@xxxxxxxxxxxxxxx, reiserfs-devel@xxxxxxxxxxxxxxx, linux-geode@xxxxxxxxxxxxxxxxxxx, 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, Nathan Chancellor <natechancellor@xxxxxxxxx>, linux-can@xxxxxxxxxxxxxxx, Linux ARM <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, linux-hwmon@xxxxxxxxxxxxxxx, Nick Desaulniers <ndesaulniers@xxxxxxxxxx>, Linux Watchdog Mailing List <linux-watchdog@xxxxxxxxxxxxxxx>, GR-Linux-NIC-Dev@xxxxxxxxxxx, Linux-MM <linux-mm@xxxxxxxxx>, Network Development <netdev@xxxxxxxxxxxxxxx>, linux-decnet-user@xxxxxxxxxxxxxxxxxxxxx, samba-technical@xxxxxxxxxxxxxxx, "Gustavo A. R. Silva" <gustavoars@xxxxxxxxxx>, linux-kernel <linux-kernel@xxxxxxxxxxxxxxx>, Linux-Renesas <linux-renesas-soc@xxxxxxxxxxxxxxx>, Edward Cree <ecree.xilinx@xxxxxxxxx>, linux-security-module <linux-security-module@xxxxxxxxxxxxxxx>, USB list <linux-usb@xxxxxxxxxxxxxxx>, tipc-discussion@xxxxxxxxxxxxxxxxxxxxx, Linux Crypto Mailing List <linux-crypto@xxxxxxxxxxxxxxx>, patches@xxxxxxxxxxxxxxxxxxxxx, Joe Perches <joe@xxxxxxxxxxx>, linux-integrity <linux-integrity@xxxxxxxxxxxxxxx>, "open list:NFS, SUNRPC, AND..." <linux-nfs@xxxxxxxxxxxxxxx>, "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@xxxxxxxxxx>, linux-hardening@xxxxxxxxxxxxxxx
- Delivery-date: Fri, 27 Nov 2020 09:37:10 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Thu, Nov 26, 2020 at 4:28 PM Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:
>
> 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, ...).
>
to allow assignments in if statements was clearly a mistake and if you
need outside information to understand the code, your code is the
issue already.
> 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
> _______________________________________________
> dri-devel mailing list
> dri-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
|