qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Cc: qemu-devel@nongnu.org, qemu-arm@nongnu.org, qemu-block@nongnu.org
Subject: Re: [RFC PATCH 00/78] Strict disable implicit fallthrough
Date: Fri, 13 Oct 2023 14:08:18 +0100	[thread overview]
Message-ID: <ZSlBQvyVMiJ6h5R3@redhat.com> (raw)
In-Reply-To: <2gxf2.nr1cq95buqhq@linaro.org>

On Fri, Oct 13, 2023 at 03:51:22PM +0300, Manos Pitsidianakis wrote:
> On Fri, 13 Oct 2023 11:14, "Daniel P. Berrangé" <berrange@redhat.com> wrote:
> > On Fri, Oct 13, 2023 at 10:47:04AM +0300, Emmanouil Pitsidianakis wrote:
> > > 
> > > Main questions this RFC poses
> > > =============================
> > > 
> > > - Is this change desirable and net-positive.
> > 
> > Yes, IMHO it is worth standardizing on use of the attribute. The allowed
> > use of comments was a nice thing by the compiler for coping with pre-existing
> > code, but using the attribute is best long term for a consistent style.
> > 
> > > - Should the `fallthrough;` pseudo-keyword be defined like in the Linux
> > >   kernel, or use glib's G_GNUC_FALLTHROUGH, or keep the already existing
> > >   QEMU_FALLTHROUGH macro.
> > 
> > As a general rule, if glib provides functionality we aim o use that
> > and not reinvent the wheel. IOW, we should just use G_GNUC_FALLTHROUGH.
> 
> I agree. My reasoning was:
> 
> - The reinvented wheel is only an attribute and not a big bunch of NIH  code

It isn't just about the amount of code, it is the familiarity of the
code. QEMU's codebase is glib based, by using glib functionality we
leverage developers' general familiarity with / knowledge of glib,
as opposed to custom QEMU approaches which need learning.

> - The macro def in glib depends on the glib version you use

If we need to depend on something that is newer than our min glib version,
then we add back compat definitino to 'include/glib-compat.h' for the older
version.

> - G_GNUC_FALLTHROUGH looks kind of abrasive to my eye, while  `fallthrough`
> blends in with other switch keywords like break.

My impression seeing this series, was exactly the opposite. I did not
like 'fallthrough' blending in with the rest of code, and also did not
like that it is a macro in lowercase, thus hiding that it is a macro

> - C23 standardises fallthrough. We might not ever support C23 but it's  good
> to be consistent with standards and other, larger projects (linux  kernel).

We're at least a decade away from being able to use anything from C23.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



  reply	other threads:[~2023-10-13 13:09 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-13  7:47 [RFC PATCH 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 01/78] include/qemu/compiler.h: replace QEMU_FALLTHROUGH with fallthrough Emmanouil Pitsidianakis
2023-10-13  8:16   ` Daniel P. Berrangé
2023-10-13  8:31     ` Manos Pitsidianakis
2023-10-13 12:28   ` Markus Armbruster
2023-10-13 12:37     ` Manos Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 02/78] block: add fallthrough pseudo-keyword Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 03/78] fpu/softfloat: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 04/78] qapi/opts-visitor: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 05/78] qobject/json: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 06/78] tcg: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 07/78] hw/virtio/virtio-balloon.c: " Emmanouil Pitsidianakis
2023-10-13  7:56   ` David Hildenbrand
2023-10-13  7:47 ` [RFC PATCH 08/78] hw/block: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 09/78] hw/acpi/aml-build.c: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 10/78] hw/ide/atapi.c: " Emmanouil Pitsidianakis
2023-10-13 22:27   ` John Snow
2023-10-13  7:47 ` [RFC PATCH 11/78] hw/timer: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 12/78] hw/usb: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 13/78] hw/adc: " Emmanouil Pitsidianakis
2023-10-13  8:13   ` Cédric Le Goater
2023-10-13  7:47 ` [RFC PATCH 14/78] util/error-report.c: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 15/78] accel/tcg: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 16/78] audio: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 17/78] ui/sdl2.c: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 18/78] ui/win32-kbd-hook.c: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 19/78] target/hppa: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 20/78] target/mips: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 21/78] target/sparc: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 22/78] target/ppc: " Emmanouil Pitsidianakis
2023-10-13  8:12   ` Cédric Le Goater
2023-10-13  7:47 ` [RFC PATCH 23/78] target/arm: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 24/78] target/alpha: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 25/78] target/i386: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 26/78] target/s390x: " Emmanouil Pitsidianakis
2023-10-13  7:57   ` David Hildenbrand
2023-10-13  7:47 ` [RFC PATCH 27/78] target/riscv: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 28/78] target/avr: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 29/78] target/cris: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 30/78] target/nios2: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 31/78] target/xtensa: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 32/78] target/m68k: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 33/78] target/rx: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 34/78] target/tricore: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 35/78] target/sh4: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 36/78] target/openrisc: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 37/78] target/hexagon: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 38/78] system/rtc.c: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 39/78] hw/scsi: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 40/78] hw/sd/sdhci.c: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 41/78] linux-user: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 42/78] hw/i386: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 43/78] hw/misc: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 44/78] hw/m68k/mcf_intc.c: " Emmanouil Pitsidianakis
2023-10-13  7:47 ` [RFC PATCH 45/78] hw/dma: " Emmanouil Pitsidianakis
2023-10-13  7:48 ` [RFC PATCH 46/78] disas: " Emmanouil Pitsidianakis
2023-10-13  7:48 ` [RFC PATCH 47/78] contrib/rdmacm-mux: " Emmanouil Pitsidianakis
2023-10-13  7:48 ` [RFC PATCH 48/78] contrib/vhost-user-scsi: " Emmanouil Pitsidianakis
2023-10-23  9:31   ` Raphael Norwitz
2023-10-13  7:48 ` [RFC PATCH 49/78] hw/arm: " Emmanouil Pitsidianakis
2023-10-13  7:48 ` [RFC PATCH 50/78] hw/audio: " Emmanouil Pitsidianakis
2023-10-13  7:48 ` [RFC PATCH 51/78] chardev: " Emmanouil Pitsidianakis
2023-10-13  7:48 ` [RFC PATCH 52/78] hw/char: " Emmanouil Pitsidianakis
2023-10-13  7:48 ` [RFC PATCH 53/78] nbd: " Emmanouil Pitsidianakis
2023-10-13  7:48 ` [RFC PATCH 54/78] hw/core: " Emmanouil Pitsidianakis
2023-10-13  7:48 ` [RFC PATCH 55/78] hw/display: " Emmanouil Pitsidianakis
2023-10-13  7:48 ` [RFC PATCH 56/78] hw/input: " Emmanouil Pitsidianakis
2023-10-13  7:48 ` [RFC PATCH 57/78] hw/net: " Emmanouil Pitsidianakis
2023-10-13  8:14 ` [RFC PATCH 00/78] Strict disable implicit fallthrough Daniel P. Berrangé
2023-10-13 12:51   ` Manos Pitsidianakis
2023-10-13 13:08     ` Daniel P. Berrangé [this message]
2023-10-13 12:15 ` BALATON Zoltan
2023-10-13 12:41 ` Markus Armbruster
2023-10-16 14:13   ` Peter Maydell
2023-10-16 14:58     ` Manos Pitsidianakis
2023-10-16 15:03       ` Peter Maydell
2023-10-16 18:15         ` Manos Pitsidianakis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZSlBQvyVMiJ6h5R3@redhat.com \
    --to=berrange@redhat.com \
    --cc=manos.pitsidianakis@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).