From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:58806) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0Sye-0005Aw-Oo for qemu-devel@nongnu.org; Mon, 05 Sep 2011 02:48:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R0Syb-0007ut-VG for qemu-devel@nongnu.org; Mon, 05 Sep 2011 02:48:16 -0400 Sender: Paolo Bonzini Message-ID: <4E6470AB.1080402@redhat.com> Date: Mon, 05 Sep 2011 08:48:11 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 7/9] openpic: avoid a warning from clang analyzer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: Anthony Liguori , qemu-ppc@nongnu.org, qemu-devel , Alexander Graf On 09/04/2011 05:52 PM, Blue Swirl wrote: > Avoid this warning by clang analyzer by defining a default case: > /src/qemu/hw/openpic.c:477:5: warning: Undefined or garbage value > returned to caller > return retval; > > Signed-off-by: Blue Swirl > --- > hw/openpic.c | 1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > > diff --git a/hw/openpic.c b/hw/openpic.c > index 26c96e2..4b883ac 100644 > --- a/hw/openpic.c > +++ b/hw/openpic.c > @@ -469,6 +469,7 @@ static inline uint32_t read_IRQreg (openpic_t > *opp, int n_IRQ, uint32_t reg) > case IRQ_IPVP: > retval = opp->src[n_IRQ].ipvp; > break; > + default: > case IRQ_IDE: > retval = opp->src[n_IRQ].ide; > break; Looks wrong, perhaps it should return 0? Paolo