Hmm, how would that look like? Like this?
if ((val < min) || (val >= max)) {
__builtin_unreachable();
}
switch (val) {
...
}
I haven't actually tried that, but if it works as intended it would actually be better yeah (not really in the case where I'm using it, because I'm switching on an integer, not an enum).