From 845baeedae9beb16e98f11fe7173a463e934363e Mon Sep 17 00:00:00 2001 From: Veera <sveera.2001@gmail.com> Date: Thu, 18 Apr 2024 17:18:03 -0400 Subject: [PATCH] Mention Variadics With No Fixed Parameter 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. --- src/items/external-blocks.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/items/external-blocks.md b/src/items/external-blocks.md index 5b911a36c..697ac2d9e 100644 --- a/src/items/external-blocks.md +++ b/src/items/external-blocks.md @@ -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: ...); } ```