Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Jun 2016 10:21:45 -0700
From:      John Baldwin <jhb@freebsd.org>
To:        Bryan Drewery <bdrewery@freebsd.org>
Cc:        Konstantin Belousov <kostikbel@gmail.com>, Conrad Meyer <cem@freebsd.org>, src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r301959 - head/sys/kern
Message-ID:  <1585557.0rxbtFOHCR@ralph.baldwin.cx>
In-Reply-To: <ebb1a491-e279-83e0-20b3-955679c3d2ac@FreeBSD.org>
References:  <201606161158.u5GBwkd1042632@repo.freebsd.org> <c0f54ecb-c78f-2551-e048-89ef95f3d53f@FreeBSD.org> <ebb1a491-e279-83e0-20b3-955679c3d2ac@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday, June 17, 2016 09:56:47 AM Bryan Drewery wrote:
> On 6/17/2016 9:51 AM, Bryan Drewery wrote:
> > On 6/16/2016 11:13 PM, Konstantin Belousov wrote:
> >> On Thu, Jun 16, 2016 at 10:17:19AM -0700, Conrad Meyer wrote:
> >>> style(9) nit: /* FALLTHROUGH */
> >>
> >> FALLTHROUGH is only applicable when there are executable statements for
> >> both cases, and first sequence of statements does not end in break.
> >> Look at the switch() example right after the FALLTHROUGH requirement
> >> in the style(9), which shows case '?'.
> >>
> > 
> > Yes the example shows code in both cases, but the text about it is more
> > strict "Elements in a switch statement that cascade should have a
> > FALLTHROUGH comment."
> > 
> 
> My personal opinion does agree with your interpretation.  I think we
> should clarify style.9 about when to use FALLTHROUGH.

As Bruce often notes, the code samples in style(9) trump the prose if there
is a conflict.  This is the first time I've ever seen anyone suggest that
an empty case body warrants a FALLTHROUGH, and I don't recall ever seeing a
single example of it in the tree.  I had assumed that the Conrad had just
misread the diff and assumed there was still a code block there, not that
Conrad actually wanted a FALLTHROUGH for an empty block.  In that case, I'm
not sure changing style.9 would help as the trigger was misreading the diff,
not confusion over the FALLTHROUGH convention.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1585557.0rxbtFOHCR>