Treat warnings as errors except deprecations

The policy you want isn't "warnings as errors", though. It's "your PR must not add any new warnings (without a darn good reason)". That's not necessarily a reason to stop the build, and it's something that accounts for "I know there's a problem here but I won't (or can't) fix it immediately".

I'm one of the people against adding compilation-wide warning flags, for a few reasons:

  • The same warning might fire in multiple files, but only be spurious in some of them. Turning it off compilation-wide means you miss those other issues, including any that might be introduced in the future.

  • There ought to be a way to silence any potentially-spurious warning within the language (think "add 'as Foo' to silence this warning" notes). I know we don't have that for a whole bunch of cases, but I'd like to see people push on the ones that are important rather than just giving up.

  • It creates language dialects.

6 Likes