From: Markus Armbruster <armbru@redhat.com>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
qemu-devel@nongnu.org, qemu-block@nongnu.org,
"Thomas Huth" <thuth@redhat.com>
Subject: Re: [PATCH v3 13/16] semihosting/arm-compat: Clean up local variable shadowing
Date: Fri, 06 Oct 2023 11:14:06 +0200 [thread overview]
Message-ID: <878r8gp0yp.fsf@pond.sub.org> (raw)
In-Reply-To: <87h6n6h93v.fsf@linaro.org> ("Alex Bennée"'s message of "Wed, 04 Oct 2023 13:19:13 +0100")
Alex Bennée <alex.bennee@linaro.org> writes:
> Philippe Mathieu-Daudé <philmd@linaro.org> writes:
>
>> Fix:
>>
>> semihosting/arm-compat-semi.c: In function ‘do_common_semihosting’:
>> semihosting/arm-compat-semi.c:379:13: warning: declaration of ‘ret’ shadows a previous local [-Wshadow=local]
>> 379 | int ret, err = 0;
>> | ^~~
>> semihosting/arm-compat-semi.c:370:14: note: shadowed declaration is here
>> 370 | uint32_t ret;
>> | ^~~
>> semihosting/arm-compat-semi.c:682:27: warning: declaration of ‘ret’
>> shadows a previous local [-Wshadow=local]
>> 682 | abi_ulong ret;
>> | ^~~
>> semihosting/arm-compat-semi.c:370:9: note: shadowed declaration is here
>> 370 | int ret;
>> | ^~~
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>> semihosting/arm-compat-semi.c | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c
>> index 564fe17f75..0033a1e018 100644
>> --- a/semihosting/arm-compat-semi.c
>> +++ b/semihosting/arm-compat-semi.c
>> @@ -367,7 +367,6 @@ void do_common_semihosting(CPUState *cs)
>> target_ulong ul_ret;
>> char * s;
>> int nr;
>> - uint32_t ret;
>> int64_t elapsed;
>>
>> nr = common_semi_arg(cs, 0) & 0xffffffffU;
>> @@ -725,6 +724,9 @@ void do_common_semihosting(CPUState *cs)
>>
>> case TARGET_SYS_EXIT:
>> case TARGET_SYS_EXIT_EXTENDED:
>> + {
>> + uint32_t ret;
>> +
>
> I suspect this could just as well be an int with an explicit cast for ret = arg1
> because the consumers are all expecting int anyway.
>
> Otherwise:
>
> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Philippe, would you like to follow up on Alex's suspicion, or would you
like me to queue the patch as is?
next prev parent reply other threads:[~2023-10-06 9:15 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-04 12:00 [PATCH v3 00/16] (few more) Steps towards enabling -Wshadow Philippe Mathieu-Daudé
2023-10-04 12:00 ` [PATCH v3 01/16] hw/audio/soundhw: Clean up global variable shadowing Philippe Mathieu-Daudé
2023-10-06 9:27 ` Thomas Huth
2023-10-04 12:00 ` [PATCH v3 02/16] hw/ide/ahci: Clean up local " Philippe Mathieu-Daudé
2023-10-05 15:48 ` John Snow
2023-10-04 12:00 ` [PATCH v3 03/16] net/net: Clean up global " Philippe Mathieu-Daudé
2023-10-06 11:10 ` Thomas Huth
2023-10-04 12:00 ` [PATCH v3 04/16] os-posix: " Philippe Mathieu-Daudé
2023-10-04 18:47 ` Eric Blake
2023-10-04 12:00 ` [PATCH v3 05/16] plugins/loader: " Philippe Mathieu-Daudé
2023-10-04 12:21 ` Alex Bennée
2023-10-04 12:00 ` [PATCH v3 06/16] qemu-img: " Philippe Mathieu-Daudé
2023-10-04 18:49 ` Eric Blake
2023-10-04 12:00 ` [PATCH v3 07/16] qemu-io: " Philippe Mathieu-Daudé
2023-10-04 18:49 ` Eric Blake
2023-10-04 12:00 ` [PATCH v3 08/16] qom/object_interfaces: " Philippe Mathieu-Daudé
2023-10-04 12:00 ` [PATCH v3 09/16] semihosting: " Philippe Mathieu-Daudé
2023-10-04 12:16 ` Alex Bennée
2023-10-04 12:33 ` Thomas Huth
2023-10-04 12:34 ` Markus Armbruster
2023-10-04 12:00 ` [PATCH v3 10/16] ui/cocoa: " Philippe Mathieu-Daudé
2023-10-05 5:15 ` Akihiko Odaki
2023-10-04 12:00 ` [PATCH v3 11/16] util/cutils: Clean up global variable shadowing in get_relocated_path() Philippe Mathieu-Daudé
2023-10-04 18:52 ` Eric Blake
2023-10-04 12:00 ` [PATCH v3 12/16] util/guest-random: Clean up global variable shadowing Philippe Mathieu-Daudé
2023-10-04 12:00 ` [PATCH v3 13/16] semihosting/arm-compat: Clean up local " Philippe Mathieu-Daudé
2023-10-04 12:19 ` Alex Bennée
2023-10-06 9:14 ` Markus Armbruster [this message]
2023-10-06 9:52 ` Philippe Mathieu-Daudé
2023-10-04 12:00 ` [PATCH v3 14/16] softmmu/vl: Clean up global " Philippe Mathieu-Daudé
2023-10-05 8:59 ` Markus Armbruster
2023-10-05 10:49 ` Philippe Mathieu-Daudé
2023-10-04 12:00 ` [PATCH v3 15/16] sysemu/tpm: " Philippe Mathieu-Daudé
2023-10-04 13:47 ` Stefan Berger
2023-10-04 12:00 ` [PATCH v3 16/16] trace/control: " Philippe Mathieu-Daudé
2023-10-04 18:41 ` Stefan Hajnoczi
2023-10-04 19:01 ` [PATCH v3 00/16] (few more) Steps towards enabling -Wshadow Richard Henderson
2023-10-06 11:03 ` Markus Armbruster
2023-10-06 11:37 ` Markus Armbruster
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=878r8gp0yp.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.