[Issue 14411] switch statement: docs/behavior differ
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sun Apr 5 10:09:50 PDT 2015
https://issues.dlang.org/show_bug.cgi?id=14411
--- Comment #2 from Ketmar Dark <ketmar at ketmar.no-ip.org> ---
specs says nothing about other cases. turn on compiler warnings and you will
see something like this:
z00.d(25): Warning: switch case fallthrough - use 'goto case;' if intended
z00.d(28): Warning: switch case fallthrough - use 'goto default;' if intended
what compiler doesn't tell you, however, is that "case 1, 2:" is not what you
may think, it equals to "case 2:".
p.s. no, i still don't know why warnings aren't turned off by default.
--
More information about the Digitalmars-d-bugs
mailing list