Open
Description
This is a tracking issue for the unsupported_calling_conventions
lint. This lint warns against
- Using
extern "cdecl"
on non-x86-32 targets. Useextern "C"
instead, there is no difference in behavior. - Using
extern "stdcall"
orextern "fastcall"
on non-x86-32 Windows targets. These ABIs are only defined for x86-32.- If you want to use "stdcall on x86-32-windows, C everywhere else", then use
extern "system"
. - Otherwise, if you really need the same function both on x86-32 and on other targets but with a different ABI, consider using the
fn_abi
crate. Also we'd be interested to hear about your use-case, so please leave a comment below.
- If you want to use "stdcall on x86-32-windows, C everywhere else", then use
Implementation history:
Original issue description
We generally accept stdcall
on non-x86-32 Windows targets (while rejecting it on other non-x86-32 targets). See the discussion about this at #86231 (comment) and #86231 (comment). However, @ChrisDenton points out that the raw-dylib
feature is more strict here. That's an inconsistency that we should probably fix?
@ChrisDenton can you give an example of what exactly is being rejected by raw-dylib here?
2025-05-05: See here for the current latest proposal.
Cc @workingjubilee @rust-lang/lang @nagisa @petrochenkov
Metadata
Metadata
Assignees
Labels
Area: Concerning the application binary interface (ABI)Category: This is a bug.Category: An issue tracking the progress of sth. like the implementation of an RFCItems that are on lang's radar and will need eventual work or consideration.Operating system: WindowsRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the language team, which will review and decide on the PR/issue.