I think we all know how compiler warnings can help prevent bugs and that it's good to have them enabled.
So the question is: how to enable all compiler warnings?
The major C++ compilers for me are:
- g++
- clang++
- Visual Studio's compiler
I am aware of the common settings for these compilers:
-Wall
-Wextra
-pedantic
(common for g++ and clang++)/W4
(vc++)
However, there are some more warnings that can be enabled more individually (like for example -Wconversion
).
Is is possible to enable all warnings without passing a huge number of individual switches? If all is impractical (due to for example lots of warnings generated by standard library headers, or many false positives), how to enable the most useful subset?
I understand "the most useful subset" differs depending on the project, but perhaps there is a good subset each project can start with.