[swift-dev] Categorization of warnings in Swift

Ted kremenek kremenek at apple.com
Wed Jan 20 00:29:46 CST 2016

> On Jan 13, 2016, at 1:43 PM, Jordan Rose via swift-dev <swift-dev at swift.org> wrote:
> Hi, Michael. As one of the people who's been a strong believer of "warning flags result in style dialects", I think it's important to establish a use case here. What will people actually do with warning categories? What warnings will we allow turning off? Under what contexts?

Perhaps I'm the outlier here, but I personally think that "warning flags result in style dialects" is not an anathema.  There is some code where stylistic enforcements need to be stricter for a variety of reasons.  While I think we should aim for a common set of warnings that are enabled to establish good hygiene in Swift code, I do think there will be cases where more warnings/errors are desired beyond what the core language defines.

I agree we don't need to eagerly classify warnings, but I'd also like to understand your criteria for why -W flags are bad thing in general and what you'd prefer to see as a better direction.  I certainly don't see it that way.  My fear is that if we are overly conservative about not having precise control over warnings is that we may hold back on adding useful warnings to the compiler because they will not be appropriate for everyone.

I also don't see #if as a solution for warning control, as you indicated in another message, as I see legitimate cases where more aggressive warnings may be desirable to enable in certain contexts.  There is also Chris's comments about other contents, like Playgrounds, where some pedantic warnings that may be on by default provide less value.

More information about the swift-dev mailing list