[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 18/32] semihosting: Clean up global variable shadowing
From: |
Markus Armbruster |
Subject: |
[PULL 18/32] semihosting: Clean up global variable shadowing |
Date: |
Fri, 6 Oct 2023 13:36:43 +0200 |
From: Philippe Mathieu-Daudé <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>
Message-ID: <20231004120019.93101-10-philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
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
- [PULL 10/32] hw/audio/soundhw: Clean up global variable shadowing, (continued)
- [PULL 10/32] hw/audio/soundhw: Clean up global variable shadowing, Markus Armbruster, 2023/10/06
- [PULL 27/32] hw/usb: Silence compiler warnings in USB code when compiling with -Wshadow, Markus Armbruster, 2023/10/06
- [PULL 26/32] target/ppc: Clean up local variable shadowing in kvm_arch_*_registers(), Markus Armbruster, 2023/10/06
- [PULL 06/32] hw/net/vhost_net: Silence compiler warning when compiling with -Wshadow, Markus Armbruster, 2023/10/06
- [PULL 21/32] util/guest-random: Clean up global variable shadowing, Markus Armbruster, 2023/10/06
- [PULL 09/32] dump: Silence compiler warning in dump code when compiling with -Wshadow, Markus Armbruster, 2023/10/06
- [PULL 05/32] audio/ossaudio: Fix compiler warning with -Wshadow, Markus Armbruster, 2023/10/06
- [PULL 01/32] hw/cxl: Fix local variable shadowing of cap_hdrs, Markus Armbruster, 2023/10/06
- [PULL 07/32] hw/virtio/virtio-pci: Avoid compiler warning with -Wshadow, Markus Armbruster, 2023/10/06
- [PULL 31/32] linux-user/syscall.c: clean up local variable shadowing in TARGET_NR_getcpu, Markus Armbruster, 2023/10/06
- [PULL 18/32] semihosting: Clean up global variable shadowing,
Markus Armbruster <=
- [PULL 13/32] os-posix: Clean up global variable shadowing, Markus Armbruster, 2023/10/06
- [PULL 32/32] linux-user/syscall.c: clean up local variable shadowing in xattr syscalls, Markus Armbruster, 2023/10/06
- [PULL 29/32] linux-user/mmap.c: clean up local variable shadowing, Markus Armbruster, 2023/10/06
- [PULL 12/32] net/net: Clean up global variable shadowing, Markus Armbruster, 2023/10/06
- [PULL 14/32] plugins/loader: Clean up global variable shadowing, Markus Armbruster, 2023/10/06
- [PULL 16/32] qemu-io: Clean up global variable shadowing, Markus Armbruster, 2023/10/06
- [PULL 03/32] target/ppc: Rename variables to avoid local variable shadowing in VUPKPX, Markus Armbruster, 2023/10/06
- [PULL 19/32] ui/cocoa: Clean up global variable shadowing, Markus Armbruster, 2023/10/06
- [PULL 22/32] semihosting/arm-compat: Clean up local variable shadowing, Markus Armbruster, 2023/10/06
- [PULL 20/32] util/cutils: Clean up global variable shadowing in get_relocated_path(), Markus Armbruster, 2023/10/06