From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Aleksandar Markovic <aleksandar.m.mail@gmail.com>
Cc: "qemu-trivial@nongnu.org" <qemu-trivial@nongnu.org>,
Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Olivier Danet <odanet@caramail.com>
Subject: Re: [PATCH 2/6] hw/display/tcx: Add missing fall through comments
Date: Wed, 18 Dec 2019 11:23:02 +0100 [thread overview]
Message-ID: <d1234e8e-4ab8-eded-c0c3-8b9c0946fdf5@redhat.com> (raw)
In-Reply-To: <CAL1e-=gPi2C41Lc7cOQnTP+gL3aW=yWpQvamzTSfdDCJOK5BEA@mail.gmail.com>
On 12/18/19 8:54 AM, Aleksandar Markovic wrote:
>
>
> On Tuesday, December 17, 2019, Philippe Mathieu-Daudé <philmd@redhat.com
> <mailto:philmd@redhat.com>> wrote:
>
> GCC9 is confused by this comment when building with
> CFLAG -Wimplicit-fallthrough=2:
>
> hw/display/tcx.c: In function ‘tcx_dac_writel’:
> hw/display/tcx.c:453:26: error: this statement may fall through
> [-Werror=implicit-fallthrough=]
> 453 | s->dac_index = (s->dac_index + 1) & 0xff; /*
> Index autoincrement */
> | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
> hw/display/tcx.c:454:9: note: here
> 454 | default:
> | ^~~~~~~
> hw/display/tcx.c: In function ‘tcx_dac_readl’:
> hw/display/tcx.c:412:22: error: this statement may fall through
> [-Werror=implicit-fallthrough=]
> 412 | s->dac_index = (s->dac_index + 1) & 0xff; /*
> Index autoincrement */
> | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
> hw/display/tcx.c:413:5: note: here
> 413 | default:
> | ^~~~~~~
> cc1: all warnings being treated as errors
>
> Add the missing fall through comments.
>
> Fixes: 55d7bfe22
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com
> <mailto:philmd@redhat.com>>
> ---
> Cc: Olivier Danet <odanet@caramail.com <mailto:odanet@caramail.com>>
> Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk
> <mailto:mark.cave-ayland@ilande.co.uk>>
> ---
> hw/display/tcx.c | 2 ++
> 1 file changed, 2 insertions(+)
>
>
> The content of the patch is fine, but the commit message is, I think,
> inacurate: gcc is not confused at all, it does what it was told to.
You are correct, I'll update the comment.
> The title is fine.
>
> diff --git a/hw/display/tcx.c b/hw/display/tcx.c
> index 14e829d3fa..abbeb30284 100644
> --- a/hw/display/tcx.c
> +++ b/hw/display/tcx.c
> @@ -410,6 +410,7 @@ static uint64_t tcx_dac_readl(void *opaque,
> hwaddr addr,
> case 2:
> val = s->b[s->dac_index] << 24;
> s->dac_index = (s->dac_index + 1) & 0xff; /* Index
> autoincrement */
> + /* fall through */
> default:
> s->dac_state = 0;
> break;
> @@ -451,6 +452,7 @@ static void tcx_dac_writel(void *opaque, hwaddr
> addr, uint64_t val,
> s->b[index] = val >> 24;
> update_palette_entries(s, index, index + 1);
> s->dac_index = (s->dac_index + 1) & 0xff; /* Index
> autoincrement */
> + /* fall through */
> default:
> s->dac_state = 0;
> break;
> --
> 2.21.0
>
>
next prev parent reply other threads:[~2019-12-18 10:24 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-17 17:34 [PATCH 0/6] Fix more GCC9 -O3 warnings Philippe Mathieu-Daudé
2019-12-17 17:34 ` [PATCH 1/6] audio/audio: Add missing fall through comment Philippe Mathieu-Daudé
2019-12-18 3:45 ` Richard Henderson
2019-12-18 8:02 ` Aleksandar Markovic
2019-12-18 10:22 ` Philippe Mathieu-Daudé
2019-12-17 17:34 ` [PATCH 2/6] hw/display/tcx: Add missing fall through comments Philippe Mathieu-Daudé
2019-12-18 3:57 ` Richard Henderson
2019-12-18 7:54 ` Aleksandar Markovic
2019-12-18 10:23 ` Philippe Mathieu-Daudé [this message]
2019-12-17 17:34 ` [PATCH 3/6] hw/net/imx_fec: Rewrite " Philippe Mathieu-Daudé
2019-12-17 17:55 ` Thomas Huth
2019-12-18 19:35 ` Thomas Huth
2019-12-18 3:45 ` Richard Henderson
2019-12-18 8:00 ` Aleksandar Markovic
2019-12-17 17:34 ` [PATCH 4/6] hw/timer/aspeed_timer: Add a fall through comment Philippe Mathieu-Daudé
2019-12-17 17:54 ` Cédric Le Goater
2019-12-18 8:26 ` Aleksandar Markovic
2019-12-17 17:34 ` [PATCH 5/6] hw/scsi/megasas: Silent GCC9 duplicated-cond warning Philippe Mathieu-Daudé
2019-12-18 4:03 ` Richard Henderson
2019-12-18 17:52 ` Philippe Mathieu-Daudé
2019-12-18 19:02 ` Richard Henderson
2020-01-07 14:56 ` Paolo Bonzini
2020-01-07 16:20 ` Hannes Reinecke
2019-12-17 17:34 ` [PATCH 6/6] qemu-io-cmds: Silent GCC9 format-overflow warning Philippe Mathieu-Daudé
2019-12-18 4:15 ` Richard Henderson
2019-12-18 17:45 ` Philippe Mathieu-Daudé
2019-12-18 19:21 ` Richard Henderson
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=d1234e8e-4ab8-eded-c0c3-8b9c0946fdf5@redhat.com \
--to=philmd@redhat.com \
--cc=aleksandar.m.mail@gmail.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=odanet@caramail.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@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).