From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50547) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ug7HV-00054O-DZ for qemu-devel@nongnu.org; Sat, 25 May 2013 01:44:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ug7HL-00058e-RL for qemu-devel@nongnu.org; Sat, 25 May 2013 01:44:41 -0400 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:40092) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ug7HL-00058J-LT for qemu-devel@nongnu.org; Sat, 25 May 2013 01:44:31 -0400 Message-ID: <51A04FB4.7000908@weilnetz.de> Date: Sat, 25 May 2013 07:44:20 +0200 From: Stefan Weil MIME-Version: 1.0 References: <1369390765-32117-1-git-send-email-sw@weilnetz.de> <20130524123310.GA20470@redhat.com> In-Reply-To: <20130524123310.GA20470@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Remove unnecessary break statements List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Richard W.M. Jones" Cc: qemu-devel@nongnu.org Am 24.05.2013 14:33, schrieb Richard W.M. Jones: > On Fri, May 24, 2013 at 12:19:25PM +0200, Stefan Weil wrote: >> Fix these warnings from cppcheck: >> >> hw/display/cirrus_vga.c:2603: >> hw/sd/sd.c:348: >> hw/timer/exynos4210_mct.c:1033: >> target-arm/translate.c:9886: >> target-s390x/mem_helper.c:518: >> target-unicore32/translate.c:1936: >> style: Consecutive return, break, continue, goto or throw statements are unnecessary. > I'm not sure what cppcheck does, but I spotted an unnecessary break > statement in the watchdog code a few days ago: > > http://git.qemu.org/?p=qemu.git;a=blob;f=hw/watchdog/watchdog.c;h=cb4e1f9e479f934532fcd4d07528feccba812b79;hb=HEAD#l131 > (line 131) > > So it's obviously not finding them all :-( > > Rich. Yes, cppcheck knows functions with attribute noreturn, but does not check for statements after such functions. That's a missing feature (or a bug). Stefan