Skip to content

Distributed: Fix a -Wparentheses warning #80450

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 1 commit into from
Apr 2, 2025

Conversation

tshortli
Copy link
Contributor

@tshortli tshortli commented Apr 1, 2025

The following warning was being emitted by newer versions of clang:

comparisons like 'X<=Y<=Z' don't have their mathematical meaning [-Wparentheses]

This code needs to be reworked to ensure that the conditions that are meant to be asserted are true.

@tshortli
Copy link
Contributor Author

tshortli commented Apr 1, 2025

@swift-ci please smoke test

@tshortli
Copy link
Contributor Author

tshortli commented Apr 1, 2025

@ktoso Let me know if you think something else should be done to resolve this.

@ktoso
Copy link
Contributor

ktoso commented Apr 1, 2025

It’s NOT safe to just ignore this and the code where we’re not strictly ordered must be fixed. It’s on my queue but behind other tasks.

here’s my PR about it which will need more work to fix the root cause: #79146 so let’s close this and I’ll get around to it soon.

thank you for the ping though, yes we gotta fix that

@tshortli
Copy link
Contributor Author

tshortli commented Apr 1, 2025

Can we at least remove (or comment out) the code that triggers the warning in the meantime so as not to spam?

The following warning was being  emitted by newer versions of clang:

```
comparisons like 'X<=Y<=Z' don't have their mathematical meaning [-Wparentheses]
```

This code needs to be reworked to ensure that the conditions that are meant to
be asserted are true.
@tshortli tshortli force-pushed the fix-parentheses-warning branch from db81c77 to 8819d6d Compare April 1, 2025 23:49
@tshortli
Copy link
Contributor Author

tshortli commented Apr 1, 2025

I pushed a new version that is just a FIXME and commenting out the assertion.

@tshortli
Copy link
Contributor Author

tshortli commented Apr 1, 2025

@swift-ci please smoke test

@ktoso
Copy link
Contributor

ktoso commented Apr 2, 2025

Heh, given we have tons of other warnings not sure this is going to push the needle much on warningless build but okey we can move to a FIXME since the assertion doesn't really work anyway. LGTM

@tshortli
Copy link
Contributor Author

tshortli commented Apr 2, 2025

I've been fixing all the warnings, that's why I'd really like to squash this one. Thanks!

@tshortli
Copy link
Contributor Author

tshortli commented Apr 2, 2025

@swift-ci please smoke test macOS

@tshortli tshortli enabled auto-merge April 2, 2025 14:18
@tshortli tshortli merged commit 192da54 into swiftlang:main Apr 2, 2025
3 checks passed
@tshortli tshortli deleted the fix-parentheses-warning branch April 2, 2025 18:22
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.

2 participants