How can I tell gcc to warn (or fail) on switch/case statements without a break?

后端 未结 6 1336
有刺的猬
有刺的猬 2021-01-17 17:50

I have a complicated switch statement, and I forgot to put a break at the end of one of the cases. This is quite legal, and as a resu

6条回答
  •  一生所求
    2021-01-17 17:56

    You could construct a regexp for grep/perl/emacs/etc to find all places where there's no break before case.

提交回复
热议问题