qemu-trivial
[Top][All Lists]
Advanced

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

Re: [Qemu-trivial] [Qemu-devel] [PATCH] vnc: Add break statement


From: Andreas Färber
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] vnc: Add break statement
Date: Sat, 25 Feb 2012 17:18:22 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120208 Thunderbird/10.0.1

Am 25.02.2012 17:09, schrieb Stefan Weil:
> Am 25.02.2012 16:57, schrieb Andreas Färber:
>> Am 25.02.2012 14:57, schrieb Stefan Weil:
>>> This was not a bug, but it is not common practice to omit the break
>>> statement
>>> from the last case statement before an empty default case.
>>>
>>> Any change of the default case would introduce a bug.
>>>
>>> This was reported as a warning by splint.
>>>
>>> Signed-off-by: Stefan Weil <address@hidden>
>>> ---
>>> ui/vnc-enc-hextile-template.h | 1 +
>>> 1 files changed, 1 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/ui/vnc-enc-hextile-template.h
>>> b/ui/vnc-enc-hextile-template.h
>>> index b9f9f5e..a7310e1 100644
>>> --- a/ui/vnc-enc-hextile-template.h
>>> +++ b/ui/vnc-enc-hextile-template.h
>>> @@ -175,6 +175,7 @@ static void CONCAT(send_hextile_tile_,
>>> NAME)(VncState *vs,
>>> /* we really don't have to invalidate either the bg or fg
>>> but we've lost the old values. oh well. */
>>> }
>>> + break;
>>> default:
>>
>> Doesn't that require a fallthrough comment for other tools then?
>>
>> Andreas
> 
> It was a fall through (so a comment would have satisfied static code
> analyzers), but with the added 'break' it no longer is.
> 
> As I tried to explain in the commit message, a fall through would
> not be reasonable in this special case.

Ah sorry, my comment was based on reading "omit break before default" in
the commit message; tired, should've looked more closely. FWIW:

Reviewed-by: Andreas Färber <address@hidden>

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

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