gcc options: warning on non-void functions without a return statement

前端 未结 1 1323
悲哀的现实
悲哀的现实 2021-01-03 05:06

Does anyone know a gcc/g++ option that generates an error/warning if there\'s a function that has a non-void return value but doesn\'t contain a return statement in its defi

相关标签:
1条回答
  • 2021-01-03 05:08

    -Wreturn-type. It's enabled by -Wall (which you should always be running with, along with -Werror -Wextra).

    0 讨论(0)
提交回复
热议问题