Skip to content

[r+] Add note about libc::exit's unsafety. #21026

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
wants to merge 1 commit into from

Conversation

steveklabnik
Copy link
Member

Fixes #19245.

@rust-highfive
Copy link
Contributor

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

///
/// fn main() {
/// unsafe {
/// libc::exit(1 as libc::c_int);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need the cast here.

@steveklabnik
Copy link
Member Author

@sfackler addressed


/// Exits the running program in a possibly dangerous manner.
///
/// # Unsafety
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last minor nit/question: Should this heading be Warning or something like that rather than Unsafety? I'm not sure how strict we want to be about the use of the term "unsafe" in documentation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that the function is an unsafe fn, I chose unsafety rather than something like "Warning".

bors added a commit that referenced this pull request Jan 14, 2015
Add note about libc::exit's unsafety.

Reviewed-by: sfackler
@nikomatsakis nikomatsakis changed the title Add note about libc::exit's unsafety. [r+] Add note about libc::exit's unsafety. Jan 14, 2015
bors added a commit that referenced this pull request Jan 17, 2015
[r+] Add note about libc::exit's unsafety.

Reviewed-by: steveklabnik
bors added a commit that referenced this pull request Jan 17, 2015
[r+] Add note about libc::exit's unsafety.

Reviewed-by: steveklabnik
@steveklabnik
Copy link
Member Author

Doing this manually as part of #21300

@steveklabnik steveklabnik deleted the gh19245 branch October 25, 2017 18:28
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.

Document (in?)ability to exit a program
6 participants