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

Suppress improper_ctypes warnings when compiling liballoc with external_features #24514

Merged
merged 1 commit into from
Apr 21, 2015

Conversation

krzysz00
Copy link
Contributor

When liballoc is compiled with --cfg feature=\"external_features\", several improper_ctypes warnings are generated. Since these warnings are harmless, I have added a directive to suppress them.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see CONTRIBUTING.md for more information.

@alexcrichton
Copy link
Member

It seems like this may be a legitimate warning? Perhaps this could use libc::size_t as an argument instead?

@krzysz00
Copy link
Contributor Author

Isn't usize Rust's equivalent of C's size_t? In both languages, they're the type returned by the "size of" operator (and unsigned). This means the warning isn't actually warning about anything bad and should be suppressed.

Using size_t might also complicate my use case, which is providing my kernel's allocator to liballoc.

@alexcrichton
Copy link
Member

Ah right that's a good point. I think that the warning here dates back to when these types were called int/uint so we may even want to consider allowing them by default in the future!

Regardless I think you're right in that this is ok, so:

@bors: r+ f64510d rollup

Thanks!

steveklabnik added a commit to steveklabnik/rust that referenced this pull request Apr 21, 2015
…=alexcrichton

When `liballoc` is compiled with `--cfg feature=\"external_features\"`, several `improper_ctypes` warnings are generated. Since these warnings are harmless, I have added a directive to suppress them.
bors added a commit that referenced this pull request Apr 21, 2015
@bors bors merged commit f64510d into rust-lang:master Apr 21, 2015
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.

4 participants