2 ms·
> some compilers issue different warnings based on compile settings Also based on which platform they're run on. > new compiler versions regularly introduce n
by nullc 5y ago
> some compilers issue different warnings based on compile settings
Also based on which platform they're run on.
> new compiler versions regularly introduce new warnings,
Much worse, IMO is older compiler versions which emit incorrect warnings. At least when a new version emits a new, correct, warning it's at least something you want to fix (or disabling a new unhelpful warning). The failure to compile may still be a practical problem but at least the direction it creates is a right one.
For older compiler versions, there may be no fix-- breaking the code or turning off the warning may be the only options if Werror is used.
Outside of heavily controlled environments, I think Werror is just plain toxic. Want to run it on your CI builds where you don't need to worry about the compiler being upgraded or downgraded without warning? Great! Everyone should do that. Being warning clean on your primary target toolchains(s) is an important move.
For code distributed to users the use of Werror use creates a pressure against introducing new and helpful warnings for compiler authors. Fortunately, it's such a nuisance for code distributed to others that no one survives enabling it for long and the worse damage it likely does is that the few projects that use it for publicly distributed code refrain from enabling many otherwise useful non-default warnings.