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

后端 未结 6 1386
有刺的猬
有刺的猬 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 18:03

    There's a discussion about such a feature (-Wswitch-break) at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7652. But it doesn't seem to be implemented yet

提交回复
热议问题