3 ms·
There is nothing wrong with -Werror, if you control the exact set of diagnostics! The problem are the "surprise me!" warning options (-Wall, -Wextra) of GCC wh
by kazinator 5y ago
There is nothing wrong with -Werror, if you control the exact set of diagnostics!
The problem are the "surprise me!" warning options (-Wall, -Wextra) of GCC which bring in diagnostics which differ from version to version. So then with -Werror, the language has become a moving target: what is considered a bad construct that stops the translation is changing.
The problem with not using -Wall and -Werror and just specifying the exact diagnostics you want, together with -Werror, is that you don't benefit from the discovery of defects brought about by new diagnostic options.
The fix for that is to have an ongoing thread of activity in your project dedicated to exploring new compiler options (supported by a special build configuration).