From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, "Markus Armbruster" <armbru@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Paolo Bonzini" <pbonzini@redhat.com>
Subject: [PATCH v3 09/16] semihosting: Clean up global variable shadowing
Date: Wed, 4 Oct 2023 14:00:12 +0200 [thread overview]
Message-ID: <20231004120019.93101-10-philmd@linaro.org> (raw)
In-Reply-To: <20231004120019.93101-1-philmd@linaro.org>
Fix:
semihosting/config.c:134:49: error: declaration shadows a variable in the global scope [-Werror,-Wshadow]
int qemu_semihosting_config_options(const char *optarg)
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:77:14: note: previous declaration is here
extern char *optarg; /* getopt(3) external variables */
^
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/semihosting/semihost.h | 2 +-
semihosting/config.c | 8 ++++----
stubs/semihost.c | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/semihosting/semihost.h b/include/semihosting/semihost.h
index efd2efa25a..97d2a2ba99 100644
--- a/include/semihosting/semihost.h
+++ b/include/semihosting/semihost.h
@@ -66,7 +66,7 @@ const char *semihosting_get_cmdline(void);
void semihosting_arg_fallback(const char *file, const char *cmd);
/* for vl.c hooks */
void qemu_semihosting_enable(void);
-int qemu_semihosting_config_options(const char *opt);
+int qemu_semihosting_config_options(const char *optstr);
void qemu_semihosting_chardev_init(void);
void qemu_semihosting_console_init(Chardev *);
#endif /* CONFIG_USER_ONLY */
diff --git a/semihosting/config.c b/semihosting/config.c
index 8ca569735d..e826457733 100644
--- a/semihosting/config.c
+++ b/semihosting/config.c
@@ -131,10 +131,10 @@ void qemu_semihosting_enable(void)
semihosting.target = SEMIHOSTING_TARGET_AUTO;
}
-int qemu_semihosting_config_options(const char *optarg)
+int qemu_semihosting_config_options(const char *optstr)
{
QemuOptsList *opt_list = qemu_find_opts("semihosting-config");
- QemuOpts *opts = qemu_opts_parse_noisily(opt_list, optarg, false);
+ QemuOpts *opts = qemu_opts_parse_noisily(opt_list, optstr, false);
semihosting.enabled = true;
@@ -155,7 +155,7 @@ int qemu_semihosting_config_options(const char *optarg)
semihosting.target = SEMIHOSTING_TARGET_AUTO;
} else {
error_report("unsupported semihosting-config %s",
- optarg);
+ optstr);
return 1;
}
} else {
@@ -165,7 +165,7 @@ int qemu_semihosting_config_options(const char *optarg)
qemu_opt_foreach(opts, add_semihosting_arg,
&semihosting, NULL);
} else {
- error_report("unsupported semihosting-config %s", optarg);
+ error_report("unsupported semihosting-config %s", optstr);
return 1;
}
diff --git a/stubs/semihost.c b/stubs/semihost.c
index aad7a70353..b3c61935b3 100644
--- a/stubs/semihost.c
+++ b/stubs/semihost.c
@@ -36,7 +36,7 @@ void qemu_semihosting_enable(void)
{
}
-int qemu_semihosting_config_options(const char *optarg)
+int qemu_semihosting_config_options(const char *optstr)
{
return 1;
}
--
2.41.0
next prev parent reply other threads:[~2023-10-04 12:03 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 ` Philippe Mathieu-Daudé [this message]
2023-10-04 12:16 ` [PATCH v3 09/16] semihosting: " 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
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=20231004120019.93101-10-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=armbru@redhat.com \
--cc=pbonzini@redhat.com \
--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 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).