Skip to content

Commit

Permalink
Add an unresolved question on support for non-native ABIs
Browse files Browse the repository at this point in the history
  • Loading branch information
joshtriplett committed Sep 15, 2017
1 parent b2acc33 commit 4042834
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions text/0000-variadic.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,3 +252,14 @@ corresponding variadic function.
Currently, Rust does not allow passing a closure to C code expecting a pointer
to an `extern "C"` function. If this becomes possible in the future, then
variadic closures would become useful, and we should add them at that time.

This RFC only supports the platform's native `"C"` ABI, not any other ABI. Code
may wish to define variadic functions for another ABI, and potentially more
than one such ABI in the same program. However, such support should not
complicate the common case. LLVM has extremely limited support for this, for
only a specific pair of platforms (supporting the Windows ABI on platforms that
use the System V ABI), with no generalized support in the underlying
intrinsics. The LLVM intrinsics only support using the ABI of the containing
function. Given the current state of the ecosystem, this RFC only proposes
supporting the native `"C"` ABI for now. Doing so will not prevent the
introduction of support for non-native ABIs in the future.

0 comments on commit 4042834

Please sign in to comment.