qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Remove unnecessary break statements


From: Stefan Weil
Subject: Re: [Qemu-devel] [PATCH] Remove unnecessary break statements
Date: Sat, 25 May 2013 07:44:20 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130510 Thunderbird/17.0.6

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]