From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, qemu-arm@nongnu.org
Subject: Re: [PATCH v2] hw/input/tsc2005: Fix -Wchar-subscripts warning in tsc2005_txrx()
Date: Wed, 29 May 2024 06:52:22 +0200 [thread overview]
Message-ID: <7d746f7d-60b3-4513-bd95-5bec7e799b67@linaro.org> (raw)
In-Reply-To: <CAFEAcA-apsUZeNdpC9QfJm+Xqr8Z-LhfZXiv6YxcSXo2bKsocQ@mail.gmail.com>
On 20/5/24 14:49, Peter Maydell wrote:
> On Wed, 8 May 2024 at 15:35, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>>
>> Check the function index is in range and use an unsigned
>> variable to avoid the following warning with GCC 13.2.0:
>>
>> [666/5358] Compiling C object libcommon.fa.p/hw_input_tsc2005.c.o
>> hw/input/tsc2005.c: In function 'tsc2005_timer_tick':
>> hw/input/tsc2005.c:416:26: warning: array subscript has type 'char' [-Wchar-subscripts]
>> 416 | s->dav |= mode_regs[s->function];
>> | ~^~~~~~~~~~
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>> v2: Use Peter suggestion
>> ---
>> hw/input/tsc2005.c | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/hw/input/tsc2005.c b/hw/input/tsc2005.c
>> index 941f163d36..8d35892c09 100644
>> --- a/hw/input/tsc2005.c
>> +++ b/hw/input/tsc2005.c
>> @@ -406,6 +406,9 @@ uint32_t tsc2005_txrx(void *opaque, uint32_t value, int len)
>> static void tsc2005_timer_tick(void *opaque)
>> {
>> TSC2005State *s = opaque;
>> + unsigned int function = s->function;
>> +
>> + assert(function < ARRAY_SIZE(mode_regs);
>
> Missing ')' -- this doesn't compile ;-)
Oops I apologize for not even build-testing :/
> Applied to target-arm.next with the typo fixed, thanks.
Thanks!
prev parent reply other threads:[~2024-05-29 4:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-08 14:35 [PATCH v2] hw/input/tsc2005: Fix -Wchar-subscripts warning in tsc2005_txrx() Philippe Mathieu-Daudé
2024-05-20 12:49 ` Peter Maydell
2024-05-29 4:52 ` Philippe Mathieu-Daudé [this message]
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=7d746f7d-60b3-4513-bd95-5bec7e799b67@linaro.org \
--to=philmd@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@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).