From: Aleksandar Markovic <aleksandar.m.mail@gmail.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
Richard Henderson <richard.henderson@linaro.org>,
QEMU Developers <qemu-devel@nongnu.org>,
Olivier Danet <odanet@caramail.com>
Subject: Re: [PATCH v2 2/6] hw/display/tcx: Add missing fall through comments
Date: Wed, 18 Dec 2019 20:36:50 +0100 [thread overview]
Message-ID: <CAL1e-=g6w3H9mHHJRgRYO=eMU8ZSQ1aMAqSGo3gVAPadmhJVgA@mail.gmail.com> (raw)
In-Reply-To: <20191218192526.13845-3-philmd@redhat.com>
On Wed, Dec 18, 2019 at 8:26 PM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> When building with GCC9 using CFLAG -Wimplicit-fallthrough=2 we get:
>
> 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
>
> Give a hint to GCC by adding the missing fall through comments.
>
> Fixes: 55d7bfe22
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> v2: Reword the description (Aleksandar)
>
Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
> Cc: Aleksandar Markovic <aleksandar.m.mail@gmail.com>
> Cc: Olivier Danet <odanet@caramail.com>
> Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> ---
> hw/display/tcx.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> 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 19:38 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-18 19:25 [PATCH v2 0/6] Fix more GCC9 -O3 warnings Philippe Mathieu-Daudé
2019-12-18 19:25 ` [PATCH v2 1/6] audio/audio: Add missing fall through comment Philippe Mathieu-Daudé
2019-12-18 19:36 ` Aleksandar Markovic
2020-01-07 7:22 ` Gerd Hoffmann
2019-12-18 19:25 ` [PATCH v2 2/6] hw/display/tcx: Add missing fall through comments Philippe Mathieu-Daudé
2019-12-18 19:36 ` Aleksandar Markovic [this message]
2019-12-22 11:12 ` Mark Cave-Ayland
2019-12-18 19:25 ` [PATCH v2 3/6] hw/timer/aspeed_timer: Add a fall through comment Philippe Mathieu-Daudé
2019-12-18 19:25 ` [PATCH v2 4/6] hw/net/imx_fec: Rewrite fall through comments Philippe Mathieu-Daudé
2019-12-18 19:36 ` Thomas Huth
2019-12-18 19:25 ` [RFC PATCH v2 5/6] hw/net/imx_fec: Remove unuseful FALLTHROUGH comments Philippe Mathieu-Daudé
2019-12-18 19:28 ` Thomas Huth
2019-12-18 19:35 ` Aleksandar Markovic
2019-12-18 20:30 ` Richard Henderson
2019-12-18 19:25 ` [RFC PATCH v2 6/6] hw/pci-host/designware: Remove unuseful FALLTHROUGH comment Philippe Mathieu-Daudé
2019-12-18 19:32 ` Thomas Huth
2019-12-18 19:35 ` Aleksandar Markovic
2019-12-18 20:31 ` Richard Henderson
2019-12-18 21:28 ` Aleksandar Markovic
2020-01-17 16:55 ` [PATCH v2 0/6] Fix more GCC9 -O3 warnings Philippe Mathieu-Daudé
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='CAL1e-=g6w3H9mHHJRgRYO=eMU8ZSQ1aMAqSGo3gVAPadmhJVgA@mail.gmail.com' \
--to=aleksandar.m.mail@gmail.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=odanet@caramail.com \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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).