Open chrchr-github opened 3 months ago
I don't think that this is a false-positive. Whether the next branch is doing anything doesn't really change whether it's a fall-through or not, and it's still most likely not intended by the author. You even say in the title that it's a fall-through.
Well, the warning is technically correct. It just doesn't improve the code much to insert a break
to avoid falling through to a break
.
Well, the warning is technically correct. It just doesn't improve the code much to insert a
break
to avoid falling through to abreak
.
I guess that's where we disagree. IMO there should either be a [[fallthrough]]
or break;
to make it clear what the intention was, since it's not clear to me currently. In this case it doesn't make a difference, but the default: break;
doesn't either. In a longer switch
I'd definitely want to make it clear.
I agree, I don't think this is a bug. Explicitly indicating fallthrough is about annotating intention.
https://godbolt.org/z/PezPf5Pn5