All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Weil <sw@weilnetz.de>
To: "Andreas Färber" <afaerber@suse.de>
Cc: QEMU Trivial <qemu-trivial@nongnu.org>,
	Anthony Liguori <aliguori@us.ibm.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] vnc: Add break statement
Date: Sat, 25 Feb 2012 17:09:38 +0100	[thread overview]
Message-ID: <4F4907C2.2080402@weilnetz.de> (raw)
In-Reply-To: <4F4904EA.5050002@suse.de>

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 <sw@weilnetz.de>
>> ---
>> 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.

Cheers, Stefan



WARNING: multiple messages have this Message-ID (diff)
From: Stefan Weil <sw@weilnetz.de>
To: "Andreas Färber" <afaerber@suse.de>
Cc: QEMU Trivial <qemu-trivial@nongnu.org>,
	Anthony Liguori <aliguori@us.ibm.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] vnc: Add break statement
Date: Sat, 25 Feb 2012 17:09:38 +0100	[thread overview]
Message-ID: <4F4907C2.2080402@weilnetz.de> (raw)
In-Reply-To: <4F4904EA.5050002@suse.de>

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 <sw@weilnetz.de>
>> ---
>> 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.

Cheers, Stefan

  reply	other threads:[~2012-02-25 16:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-25 13:57 [Qemu-trivial] [PATCH] vnc: Add break statement Stefan Weil
2012-02-25 13:57 ` [Qemu-devel] " Stefan Weil
2012-02-25 14:18 ` [Qemu-trivial] " Eric Blake
2012-02-25 14:18   ` Eric Blake
2012-02-25 14:38   ` [Qemu-trivial] " Stefan Weil
2012-02-25 14:38     ` Stefan Weil
2012-02-25 15:57 ` [Qemu-trivial] " Andreas Färber
2012-02-25 15:57   ` Andreas Färber
2012-02-25 16:09   ` Stefan Weil [this message]
2012-02-25 16:09     ` Stefan Weil
2012-02-25 16:18     ` [Qemu-trivial] " Andreas Färber
2012-02-25 16:18       ` Andreas Färber

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=4F4907C2.2080402@weilnetz.de \
    --to=sw@weilnetz.de \
    --cc=afaerber@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /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.