From: Stefan Weil <sw@weilnetz.de>
To: David Gibson <david@gibson.dropbear.id.au>,
Alexander Graf <agraf@suse.de>
Cc: Stefan Weil <sw@weilnetz.de>, qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH 3/3] spapr: Fix compiler warning for some versions of gcc (spapr_io_read)
Date: Mon, 24 Jun 2013 19:48:49 +0200 [thread overview]
Message-ID: <1372096130-24994-4-git-send-email-sw@weilnetz.de> (raw)
In-Reply-To: <1372096130-24994-1-git-send-email-sw@weilnetz.de>
i686-w64-mingw32-gcc (GCC) 4.6.3 from Debian wheezy reports this warning:
hw/ppc/spapr_pci.c:454:1: warning:
control reaches end of non-void function [-Wreturn-type]
Adding a default case to the switch statement satisfies the compiler.
This modification requires moving the assert statement.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
hw/ppc/spapr_pci.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index 04e8362..c04086c 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -448,9 +448,10 @@ static uint64_t spapr_io_read(void *opaque, hwaddr addr,
case 2:
return cpu_inw(addr);
case 4:
+ default:
+ assert(size == 4);
return cpu_inl(addr);
}
- assert(0);
}
static void spapr_io_write(void *opaque, hwaddr addr,
--
1.7.10.4
next prev parent reply other threads:[~2013-06-24 17:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-24 17:48 [Qemu-devel] [PATCH 0/3] spapr: Fix remaining compiler warnings Stefan Weil
2013-06-24 17:48 ` [Qemu-devel] [PATCH 1/3] spapr: Use named enum for function remove_hpte Stefan Weil
2013-07-02 12:45 ` Alexander Graf
2013-06-24 17:48 ` [Qemu-devel] [PATCH 2/3] spapr: Fix compiler warning for some versions of gcc (h_remove) Stefan Weil
2013-06-24 20:27 ` Paolo Bonzini
2013-06-24 20:35 ` Stefan Weil
2013-06-24 21:07 ` Paolo Bonzini
2013-06-24 17:48 ` Stefan Weil [this message]
2013-07-02 12:45 ` [Qemu-devel] [PATCH 3/3] spapr: Fix compiler warning for some versions of gcc (spapr_io_read) Alexander Graf
2013-07-02 20:22 ` Stefan Weil
2013-07-02 20:25 ` Alexander Graf
2013-06-26 8:14 ` [Qemu-devel] [PATCH 0/3] spapr: Fix remaining compiler warnings Paolo Bonzini
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=1372096130-24994-4-git-send-email-sw@weilnetz.de \
--to=sw@weilnetz.de \
--cc=agraf@suse.de \
--cc=david@gibson.dropbear.id.au \
--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).