Skip to content

Fix unused variable errors #576

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

Conversation

etcwilde
Copy link
Contributor

There are build errors due to unused variables in two of the tests.
The build system builds these with -Werror so instead of a warning, it is a hard failure.

This is affecting the swift rebranch work, which has a newer clang that emits warnings in more cases, which is why we are seeing this now.

Failing build log:
https://ci.swift.org/view/Swift%20rebranch/job/oss-swift-rebranch-incremental-RA-linux-ubuntu-18_04/23/console

Variable 'j' is unused in this test and clang emits a warning. `-Werror`
is enabled, so this warning is actually emitted as an error.
In only one of the ifdef cases is the `to` variable used.
Clang on the rebranch branch recognizes this to be unused on the other
branches and emits a warning. This project has `-Werror` enabled, so
this results in a build failure.

I moved the entire code block down closer to where it is used because it
isn't entirely clear based on where it used to sit given the number of
macro ifdef's between declaration and usage.
@etcwilde etcwilde requested a review from rokhinip September 22, 2021 00:01
@etcwilde
Copy link
Contributor Author

@swift-ci please test

@etcwilde etcwilde merged commit 35f5c96 into swiftlang:main Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant