All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Stefan Weil <sw@weilnetz.de>
Cc: qemu-devel <qemu-devel@nongnu.org>,
	David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-devel] [PATCH 3/3] spapr: Fix compiler warning for some versions of gcc (spapr_io_read)
Date: Tue, 02 Jul 2013 14:45:23 +0200	[thread overview]
Message-ID: <51D2CB63.1020308@suse.de> (raw)
In-Reply-To: <1372096130-24994-4-git-send-email-sw@weilnetz.de>

On 06/24/2013 07:48 PM, Stefan Weil wrote:
> 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);

Please fix this one up with g_assert_not_reached() as well.


Alex

  reply	other threads:[~2013-07-02 12:45 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 ` [Qemu-devel] [PATCH 3/3] spapr: Fix compiler warning for some versions of gcc (spapr_io_read) Stefan Weil
2013-07-02 12:45   ` Alexander Graf [this message]
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=51D2CB63.1020308@suse.de \
    --to=agraf@suse.de \
    --cc=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=sw@weilnetz.de \
    /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.