Skip to content

Quell some warnings about casting in the runtime. #19437

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
Sep 21, 2018

Conversation

jckarter
Copy link
Contributor

No description provided.

@jckarter
Copy link
Contributor Author

@swift-ci Please smoke test

@jrose-apple
Copy link
Contributor

:-( Please fix this with a const_cast, not by chaining reinterpret_casts.

@jckarter
Copy link
Contributor Author

That makes it more verbose, but does it really make it clearer?

@jckarter jckarter merged commit 7f22a26 into swiftlang:master Sep 21, 2018
@jrose-apple
Copy link
Contributor

It's not about clarity; it's about the compiler telling me when the type is wrong next time the code is edited.

@jckarter
Copy link
Contributor Author

The types here are already "wrong", and a combination of const_cast(reinterpret_cast()) allows conversion from any type to any other, so I don't really see how it improves maintainability either.

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