Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treat warnings as errors across the codebase #1249

Merged
merged 3 commits into from Dec 2, 2021

Conversation

lawrence-forooghian
Copy link
Collaborator

This:

  1. fixes all of our compiler warnings;
  2. turns on the "treat warnings as errors" compiler settings across the codebase.

Hopefully it's fairly self-explanatory why this is a good thing — warnings aren't in any way flagged by CI otherwise, so it's far too easy to introduce new ones.

Our tests are using the deprecated
-ARTClientOptions.fallbackHostsUseDefault property. We can’t remove this
usage until we remove the property. But we want to be able to turn on
“treat warnings as errors” so we need a way to suppress the resultant
compiler warning.

Swift doesn’t really provide options for suppressing warnings, so
instead we take advantage of the fact that it doesn’t emit warnings when
using deprecated functionality inside of a method which is itself marked
as deprecated. See
https://forums.swift.org/t/swift-should-allow-for-suppression-of-warnings-especially-those-that-come-from-objective-c/19216/68.
The warning is:

> Treating a forced downcast to 'ARTMessage' as optional will never
> produce 'nil'
@lawrence-forooghian lawrence-forooghian merged commit 3b6e335 into main Dec 2, 2021
@lawrence-forooghian lawrence-forooghian deleted the treat-warnings-as-errors branch December 2, 2021 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants