Re: Implicit case fallthrough warns only when a statement is in place

2011-11-07 Thread bearophile
Andrej Mitrovic: > I did have a bug pop up because I was relying on this new fallthrough > warning system, but it failed to warn me because I didn't have a > statement in one of my cases (I forgot to put a break). -.- This is the consequence of special cases piled on special cases, in the D desi

Re: Implicit case fallthrough warns only when a statement is in place

2011-11-07 Thread Jonathan M Davis
On Monday, November 07, 2011 15:38 Andrej Mitrovic wrote: > import std.stdio; > > void main() > { > int y; > switch (y) > { > case 0: > { > // no warning here on fallthrough > } > > case 1: > { > goto case 2; > } > > case 2: > { > writeln("2"); > break; > } > > default: > } > } > > This won't

Implicit case fallthrough warns only when a statement is in place

2011-11-07 Thread Andrej Mitrovic
import std.stdio; void main() { int y; switch (y) { case 0: { // no warning here on fallthrough } case 1: { goto case 2; } case 2: { writeln("2"); break; }