diff --git a/src/items/external-blocks.md b/src/items/external-blocks.md index 0e048228d1..afe6d1945f 100644 --- a/src/items/external-blocks.md +++ b/src/items/external-blocks.md @@ -189,6 +189,16 @@ 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 within `extern` blocks with the following ABI strings or their corresponding [`-unwind` variants][items.fn.extern.unwind]: + +- `"aapcs"` +- `"C"` +- `"cdecl"` +- `"efiapi"` +- `"sysv64"` +- `"win64"` + r[items.extern.attributes] ## Attributes on extern blocks diff --git a/src/types/function-pointer.md b/src/types/function-pointer.md index 03c8793662..239638413f 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 one of those listed in [items.extern.variadic.conventions]. r[type.fn-pointer.attributes] ## Attributes on function pointer parameters