Quote:
My biggest concern was that deviating from the standard behavior of switch would cause confusion, and easily lead to mistakes in code.
I don't think its that big an issue, but using a different keyword is probably still wise so people don't just C&P a block of normal C code and not be aware of the differing semantics
Having said that, structures like this are actually quite common - the entire Visual Basic line (all the way up to VB.Net 2017 or whatever the latest version is) has a Select Case statement that uses exactly these semantics, including implied break on next case. A lot of more modern languages like Go and Rust also eschew fall-through; the argument being that "forgetting a break" is very common and causes many bugs, but the flexibility of allowing fall-through is useful only occassionally.
VB.Net e.g.
Code:
Public Function WhatNumber(ByRef Number As Integer)
Select Case Number
Case 1
MsgBox("1")
Case 2, 3
MsgBox("> 1, < 4
Case Else
MsgBox("> 3")
End Select
End Function
_________________
Want to design a PCB for your project? I strongly recommend
KiCad. Its free, its multiplatform, and its easy to learn!
Also, I maintain KiCad libraries of
Retro Computing and
Arduino components you might find useful.