How to turn on (literally) ALL of GCC's warnin

2019-01-03 21:34发布

I would like to enable -- literally -- ALL of the warnings that GCC has. (You'd think it would be easy...)

  • You'd think -Wall might do the trick, but nope! Still need -Wextra.

  • You'd think -Wextra might do the trick, but nope! Not all of the warnings listed here (for example, -Wshadow) are enabled by this. And I still have no idea if this list is comprehensive.

How do I tell GCC to enable (no if's, and's, or but's!) all the warnings it has?

7条回答
叛逆
2楼-- · 2019-01-03 22:26

And I still have no idea if this list is comprehensive.

It probably is, but the only list that is 100% comprehensive is the actual source for the compiler. However, GCC is big! And I don't know if all command-line parameters are collected in one place or spread out over several source files. Also note that some warnings are for the pre-processor, some for the actual compiler and some for the linker (which is a completely separate program, and found in the binutils package) so they most likely are spread out.

查看更多
登录 后发表回答