* [Qemu-devel] Patch for 'set but not used' variable in atapi.c
@ 2011-04-27 18:37 Yaniv Kaul
0 siblings, 0 replies; only message in thread
From: Yaniv Kaul @ 2011-04-27 18:37 UTC (permalink / raw)
To: qemu-devel
I'm pretty sure it's not in the right format, without signed-off, etc,
but perhaps it could be put into the trivial or block branches.
Fixes the following error (with gcc 4.6, default settings):
/home/ykaul/qemu/hw/ide/atapi.c: In function ‘ide_atapi_cmd’:
/home/ykaul/qemu/hw/ide/atapi.c:1083:20: error: variable ‘packet’ set
but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors
Regretfully, there are more to fix, with or without KVM support. The tcg
one puzzles me a bit:
CC x86_64-softmmu/tcg/tcg.o
/home/ykaul/qemu/tcg/tcg.c: In function ‘tcg_gen_callN’:
/home/ykaul/qemu/tcg/tcg.c:589:9: error: variable ‘call_type’ set but
not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors
Removing the variable and the set line actually works, although I see
the variables used few lines later. Some #ifdef I'm not seeing, probably.
Thanks,
Y.
Signed-off-by: Yaniv Kaul<address@hidden>
---
diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c
index 690a0ab..334d6fd 100644
--- a/hw/ide/atapi.c
+++ b/hw/ide/atapi.c
@@ -1080,10 +1080,12 @@ static const struct {
void ide_atapi_cmd(IDEState *s)
{
- const uint8_t *packet;
uint8_t *buf;
+#ifdef DEBUG_IDE_ATAPI
+ const uint8_t *packet;
packet = s->io_buffer;
+#endif
buf = s->io_buffer;
#ifdef DEBUG_IDE_ATAPI
{
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-04-27 18:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-27 18:37 [Qemu-devel] Patch for 'set but not used' variable in atapi.c Yaniv Kaul
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).