Implicit fall through not detected (Example from lex.html)

Andre via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Mar 3 02:15:53 PST 2015


On Tuesday, 3 March 2015 at 07:27:33 UTC, ketmar wrote:
>
> implicit fallthru is not a fatal bug (but i believe it should 
> be), it
> generates only warning.

I am also not really happy with the actual behavor (w / wi switch 
needed) because the documentation is clear about that it is an 
error:

-- from language reference:
A ScopeStatementList must either be empty, or be ended with a 
ContinueStatement, BreakStatement, ReturnStatement, 
GotoStatement, ThrowStatement or assert(0) expression unless this 
is the last case. This is to set apart with C's error-prone 
implicit fall-through behavior. goto case; could be used for 
explicit fall-through
--

Fortunately dub is using the correct switches by default

Kind regards
André


More information about the Digitalmars-d-learn mailing list