Skip to content

Commit

Permalink
Mention Variadics With No Fixed Parameter
Browse files Browse the repository at this point in the history
There's an open PR to support C23's variadics without a named
parameter in Rust's extern blocks. Currently, it's waiting on
approval from T-lang to get merged.

This PR removes the line "There must be at least one parameter
before the variadic parameter" and adds an example to highlight
that we support variadics without any named parameters.

Opening this now so it can get merged after the implementation
gets approved by T-lang.
  • Loading branch information
veera-sivarajan authored and ehuss committed May 30, 2024
1 parent 02674ce commit 845baee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/items/external-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ There are also some platform-specific ABI strings:
## Variadic functions

Functions within external blocks may be variadic by specifying `...` as the
last argument. There must be at least one parameter before the variadic
parameter. The variadic parameter may optionally be specified with an
last argument. The variadic parameter may optionally be specified with an
identifier.

```rust
extern "C" {
fn foo(x: i32, ...);
fn foo(...);
fn bar(x: i32, ...);
fn with_name(format: *const u8, args: ...);
}
```
Expand Down

0 comments on commit 845baee

Please sign in to comment.