Skip to content
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

libc types exposed by libstd #29774

Closed
arcnmx opened this issue Nov 11, 2015 · 0 comments
Closed

libc types exposed by libstd #29774

arcnmx opened this issue Nov 11, 2015 · 0 comments

Comments

@arcnmx
Copy link
Contributor

arcnmx commented Nov 11, 2015

The libc merge was a breaking change: c_char on ARM Linux was i8 but is now u8. This is a bugfix, which is fair, it was wrong before. This type is exposed via CStr::as_ptr() however, and there was no obvious way to refer to it, so users would depend on and use the crates.io libc::c_char, which only corresponds if using (old rustc + libc 0.1) or (new rustc + libc 0.2).

Note that os::raw::c_char is still wrong/old, so even using that would break.

cc @alexcrichton

Manishearth added a commit to Manishearth/rust that referenced this issue Nov 11, 2015
It's a bit strange to expect users of `libstd` to require the use of an external crates.io crate to work with standard types. This commit encourages the use `os::raw::c_char` instead, although users are certainly free to use `libc::c_char` if they wish; the test still exists to ensure the two types are identical (though the reported bug only exists on platforms that are not officially tested).

Fixes rust-lang#29774
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

No branches or pull requests

2 participants