From a7cb5490c24a2b053f436782ee5506c238fac51d Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 17 Jul 2025 14:14:35 +0200 Subject: [PATCH] update for more ABIs supporting c-variadics --- src/items/external-blocks.md | 12 ++++++++++++ src/types/function-pointer.md | 5 +---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/items/external-blocks.md b/src/items/external-blocks.md index b60cb4505..e75e8b5c4 100644 --- a/src/items/external-blocks.md +++ b/src/items/external-blocks.md @@ -187,6 +187,18 @@ unsafe extern "C" { > [!WARNING] > The `safe` qualifier should not be used on a function in an `extern` block unless that function guarantees that it will not access the variadic arguments at all. Passing an unexpected number of arguments or arguments of unexpected type to a variadic function may lead to [undefined behavior][undefined]. +r[items.extern.variadic.conventions] +Variadic parameters can only be specified with `extern` blocks with the following ABI strings: +- `"aapcs"` +- `"C"` +- `"cdecl"` +- `"efiapi"` +- `"system"` +- `"sysv64"` +- `"win64"` + +This also includes the corresponding [`-unwind` variants][items.fn.extern.unwind]. + r[items.extern.attributes] ## Attributes on extern blocks diff --git a/src/types/function-pointer.md b/src/types/function-pointer.md index 03c879366..41ee2030b 100644 --- a/src/types/function-pointer.md +++ b/src/types/function-pointer.md @@ -50,10 +50,7 @@ The `unsafe` qualifier indicates that the type's value is an [unsafe function], and the `extern` qualifier indicates it is an [extern function]. r[type.fn-pointer.constraint-variadic] -Variadic parameters can only be specified with [`extern`] function types with -the `"C"` or `"cdecl"` calling convention. - -This also includes the corresponding [`-unwind` variants][items.fn.extern.unwind]. +For the function to be variadic, its `extern` ABI must be on the [list of ABIs that allow variadic calls][items.extern.variadic.conventions]. r[type.fn-pointer.attributes] ## Attributes on function pointer parameters