Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Should extern "C" include "C" #451

Closed
nrc opened this issue Oct 13, 2015 · 6 comments
Closed

Should extern "C" include "C" #451

nrc opened this issue Oct 13, 2015 · 6 comments
Labels

Comments

@nrc
Copy link
Member

nrc commented Oct 13, 2015

I.e., should we format extern "C" fn as that or extern fn?

We should have an option for both versions, but I'm not sure which should be the default.

@barosl
Copy link

barosl commented Oct 13, 2015

Personally I prefer extern fn, because I consider the C ABI as a lingua franca of the FFI world and this doesn't seem to change in the near future.

@retep998
Copy link
Member

On 32-bit Windows both cdecl and stdcall are really popular. cdecl is the same as "C", and what most libraries use by default, while stdcall is the same as "system" and is used for almost the entirety of Windows API and also some libraries. As such I feel that it is always a good idea to specify the ABI and I'd prefer to have it explicit as the default.

@marcusklaas
Copy link
Contributor

I think we drop the annotation by default for extern blocks. I have no preference, but we should be consistent at least.

@nrc
Copy link
Member Author

nrc commented Apr 23, 2016

Reopening because we need to decide on a default value before 1.0.

@marcusklaas
Copy link
Contributor

No strong opinion here. Leaning towards explicit default.

@nrc
Copy link
Member Author

nrc commented Jan 18, 2017

Closing in favour of rust-lang/style-team#52

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants