apple / swift-nio-ssl

TLS Support for SwiftNIO, based on BoringSSL.
https://swiftpackageindex.com/apple/swift-nio-ssl/main/documentation/niossl
Apache License 2.0
385 stars 139 forks source link

Implicit conversion loses integer precision warnings #418

Open tobiasjordan opened 1 year ago

tobiasjordan commented 1 year ago

SwiftNIO commit hash: 845a97cbd5516ea9a5ed0f2788c4e38b3ee270dd

Context: For a while now, building this package (with a recent Xcode Version (14.x)) produces 220 Implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' warnings. Any chance of getting this fixed?

The reason this is becoming a problem for me is because I run my Xcode project - which embeds this library as a Swift package - using the xcodebuild cli, treating all warnings as errors which then causes my CI pipeline to fail. As I couldn't find any way to disable (certain) warnings only in Swift packages, I'm creating this issue now. Thank you very much for any info on this, I'd very much appreciate it!

Steps to reproduce:

  1. Clone repo, open Swift.package in Xcode 14
  2. Build

$ swift --version swift-driver version: 1.62.15 Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51) Target: arm64-apple-macosx13.0

Operating system: macOS 13.1 (22C65)

$ uname -a Darwin M1-MacBook-Pro.local 22.2.0 Darwin Kernel Version 22.2.0: Fri Nov 11 02:03:51 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T6000 arm64

Lukasa commented 1 year ago

Unfortunately, these warnings come from code we don’t control, the BoringSSL layer. The issue has been reported upstream. Unfortunately for now there really isn’t anything we can do unless you can convince Xcode to remove the flag mentioned in that issue.

tobiasjordan commented 1 year ago

Ah, got it, thank you for the explanation, @Lukasa. I had just quickly skimmed through the source code and because the affected source files were not an actual Swift dependency, I was under the impression the source was belonging to project. Glad to hear this is actively being worked on, though.