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

pub extern fn functions without #[no_mangle] #376

Closed
kornelski opened this Issue Sep 2, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@kornelski
Copy link
Contributor

kornelski commented Sep 2, 2016

src/unix/bsd/apple/mod.rs defines functions that look like replacements for POSIX macros:

    pub fn WSTOPSIG(status: ::c_int) -> ::c_int {
        status >> 8
    }

macro_rules! f makes these functions pub unsafe extern fn, but does not add #[no_mangle], which makes them not callable from C under these names.

Is lack of C-compatible names intentional?

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Sep 2, 2016

This is indeed intentional! This crate doesn't have a C ABI, it's just intends the Rust interface to look like a C header file basically.

@comex

This comment has been minimized.

Copy link

comex commented Sep 3, 2016

Then do these functions actually need to be extern?

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Sep 3, 2016

As far as I know, no

Susurrus pushed a commit to Susurrus/libc that referenced this issue Mar 26, 2017

Auto merge of rust-lang#376 - kamalmarhubi:warnings-in-test, r=utkars…
…hkukreti

Only deny warnings in test

This prevents us breaking builds under newer Rust versions with
additional warnings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.