I have a complicated switch
statement, and I forgot to put a break
at the end of one of the case
s. This is quite legal, and as a result I had a fall-through to the next case
.
Is there any way to have gcc warn (or even better, fail) if I neglect to put a break
statement?
I realize that there are many valid use cases (and I use them often in my code), as exemplified in this question, so obviously such a warning (or failure) would need a simple waiver so that I could easily say, "I do want to fall-through here."
Is there any way to tell gcc to do this?