Skip to content

Ignore return value of signal() on Android #3181

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

Merged
merged 3 commits into from
Apr 8, 2025
Merged

Conversation

marcprux
Copy link
Contributor

@marcprux marcprux commented Apr 7, 2025

Fixes #3180 by ignoring return value of signal() on Android

marcprux added 2 commits April 7, 2025 12:06
…urces/NIOPerformanceTester/LockBenchmark.swiftif os(Android) check unnecesary
@finagolfin
Copy link
Contributor

My Android CI just hit this too, and this pull fixes it when I tried it natively on Android. I don't know why simply defining the type and a temp variable for the output fixes this error, but it does.

Copy link
Contributor

@glbrntt glbrntt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@glbrntt glbrntt added the semver/none No version bump required. label Apr 8, 2025
@marcprux
Copy link
Contributor Author

marcprux commented Apr 8, 2025

I don't know why simply defining the type and a temp variable for the output fixes this error, but it does.

I'm guessing that nullability annotations are making the return value non-nil for Android, but nullable on Darwin.

func f0() -> (() -> ())? {
    { }
}

f0() // warning: Result of call to 'f0()' is unused

func f1() -> (() -> ()) {
    { }
}

f1() // error: Function is unused
_ = f1() // fine

marcprux added a commit to swift-everywhere/swift-package-builds that referenced this pull request Apr 8, 2025
@glbrntt glbrntt enabled auto-merge (squash) April 8, 2025 12:09
@glbrntt
Copy link
Contributor

glbrntt commented Apr 8, 2025

@marcprux could you rebase your branch on main? GitHub isn't giving me the option for some reason...

@glbrntt glbrntt merged commit c626de9 into apple:main Apr 8, 2025
40 of 41 checks passed
marcprux added a commit to swift-everywhere/swift-package-builds that referenced this pull request Apr 8, 2025
Lukasa pushed a commit to apple/swift-nio-extras that referenced this pull request Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/none No version bump required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build error on Android: call to signal yields "error: function is unused"
3 participants