3 ms·
well, clearly not "maximum warnings" since you are missing a lot of them. -pedantic -Wunreachable-code -Wcast-qual -Wswitch-default -Wconversion -Wshadow -Wstr
by Snetry 4y ago
well, clearly not "maximum warnings" since you are missing a lot of them.
-pedantic -Wunreachable-code -Wcast-qual -Wswitch-default -Wconversion -Wshadow -Wstrict-aliasing -Winit-self -Wcast-align -Wpointer-arith -Wmissing-declarations -Wmissing-include-dirs -Wno-unused-parameter -Wuninitialized and thats not even all that are useful.
Also, don't use -Werror if you can
Warnings will change based on compiler, compiler version and a countless number of other factors that make working with code that turns them into errors a pain.
- throwway120385 4y agoI actually do what parent does for work projects but I also control the compiler and can decide when to upgrade. Like everything it's a trade-off and if I wanted wide support for different platforms I would consider your advice.
- Snetry 4y agoDo you only control the compiler or the entire toolchain and system? If only the compiler you are still on very shaky grounds with -Werror. Even for the Linux kernel devs -Werror is too harsh.
- flohofwoe 4y agoA good strategy is to use -Werror in development mode and CI builds, but not in 'distribution mode' (or alternatively: use -Werror for your own code, but not for imported libraries).