Switch case falltrhough, regression or intended behavior ?
Jonathan M Davis
jmdavisProg at gmx.com
Sun Feb 17 12:07:31 PST 2013
On Sunday, February 17, 2013 17:26:01 Stewart Gordon wrote:
> On 17/02/2013 16:10, deadalnix wrote:
> > I have several instance of cases like this :
> >
> > switch(c) {
> >
> > case 'U', 'u' :
> >
> > case 'L', 'l' :
> > // code . . .
> >
> > }
> >
> > dmd from master complains about it (Error: switch case fallthrough - use
> > 'goto case;' if intended). It used to work.
>
> <snip>
>
> Implicit fall through shouldn't have been allowed from the beginning. It
> would appear that this has finally been banned.
Implicit fallthrough is a warning when a case stament is non-empty, but if
it's empty (as in the example), then there is no warning. If the compiler is
warning about falling through an empty case statement, it's a bug.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list