What is the difference between extern fn and extern "C" fn in Rust?

I tried reading various github issues trying to track what the difference is and just ended the embarrassment.

#[no_mangle]
pub extern fn foo() {
   ...
}

vs.

#[no_mangle]
pub extern "C" fn foo() {
   ...
}
+6
source share
1 answer

There is no difference as the link says:

By default, external blocks assume that the library they call uses standard C ABI on a specific platform.

extern "C"- This is the same as extern fn foo();whatever your C compiler supports.

was created to always require explicit reference extern "C", but Denied by the RFC .

issue fmt-rfcs about " extern "C" fn extern fn?".

+10

All Articles