That's the fix, yeah. You tell it where you do want to allow fallthrough, so that it can tell you if you ever forget a break anywhere else.
At this point, I don't think it's possible to change the standard so that the language automatically inserts breaks, because that would break a ton of perfectly legal code. It might be possible to add an attribute for it, like [[auto_break]], though, perhaps?
Well, no, it can't be changed now, but I was talking about what I might be okay with if the language had been designed differently, or if I was using a different language without automatic fall through.
View all comments
Show parent comment
1
u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" Sep 06 '26
Doesn't that just suppress warnings about missing breaks? I was talking about if the language automatically inserted breaks for you.