On Sun, May 09, 2021 at 09:55:57PM +0800, 陳偉銘 wrote: > >Leon Romanovsky <leon@xxxxxxxxxx> 於 2021年5月9日 週日 下午8:22寫道: > > Please don't top-post, use HTML emails and always CC mailing list. > > > I'm saying that there is a difference between two following snippets: > > switch (value) { > > case STATE_ONE: > > do_something(); > > case STATE_TWO: > > do_other(); > > break; > > default: > > WARN("unknown state"); > > } > > and > > > > switch (value) { > > case STATE_ONE: > > case STATE_TWO: > > do_other(); > > break; > > default: > > WARN("unknown state"); > > } > > > > While the first one needs "fallthrough" keyword, the second one doesn't. > > > Thanks > > Hi, > > Sorry for making trouble, hope that I make it right this time. > > Thanks for the detailed explanation, since that it is not needed to use > "fallthrough" if no code in "case", maybe we should clarify for this > condition in the documentataion? Otherwise, I guess there might be someone > else like me making this mistake again in the future. I don't think that it is necessary. Thanks. > > Thanks! > > Wei Ming Chen