Skip to content

Consider mandating extern "C++" for C++ things #137

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

Closed
dtolnay opened this issue Apr 23, 2020 · 1 comment · Fixed by #454
Closed

Consider mandating extern "C++" for C++ things #137

dtolnay opened this issue Apr 23, 2020 · 1 comment · Fixed by #454

Comments

@dtolnay
Copy link
Owner

dtolnay commented Apr 23, 2020

We currently accept both extern "C" and extern "C++" and treat them the same.

However with #4 we may end up wanting to translate the two languages somewhat differently, in particular mapping Rust references to pointers in C and references in C++.

We can't make this change in the near term because until recently Rustfmt would silently rewrite extern "C++" into extern "Rust" (rust-lang/rustfmt#4086). 🤦🤦‍♀️🤦‍♂️

@dtolnay dtolnay added the blocked Can't make progress in the immediate term label Apr 28, 2020
@adetaylor
Copy link
Collaborator

Rustfmt would silently rewrite extern "C++" into extern "Rust"

If only it did that for more general C++ code.

@dtolnay dtolnay removed the blocked Can't make progress in the immediate term label Sep 5, 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 a pull request may close this issue.

2 participants