svn commit: r301959 - head/sys/kern

John Baldwin jhb at freebsd.org
Fri Jun 17 17:22:02 UTC 2016


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


More information about the svn-src-head mailing list