Skip to content

Commit e5a1af4

Browse files
authored
Merge pull request #1936 from RalfJung/c-variadics
update for more ABIs supporting c-variadics
2 parents 70ff5df + 596cfde commit e5a1af4

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/items/external-blocks.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,16 @@ unsafe extern "C" {
189189
> [!WARNING]
190190
> 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].
191191
192+
r[items.extern.variadic.conventions]
193+
Variadic parameters can only be specified within `extern` blocks with the following ABI strings or their corresponding [`-unwind` variants][items.fn.extern.unwind]:
194+
195+
- `"aapcs"`
196+
- `"C"`
197+
- `"cdecl"`
198+
- `"efiapi"`
199+
- `"sysv64"`
200+
- `"win64"`
201+
192202
r[items.extern.attributes]
193203
## Attributes on extern blocks
194204

src/types/function-pointer.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,7 @@ The `unsafe` qualifier indicates that the type's value is an [unsafe
5050
function], and the `extern` qualifier indicates it is an [extern function].
5151

5252
r[type.fn-pointer.constraint-variadic]
53-
Variadic parameters can only be specified with [`extern`] function types with
54-
the `"C"` or `"cdecl"` calling convention.
55-
56-
This also includes the corresponding [`-unwind` variants][items.fn.extern.unwind].
53+
For the function to be variadic, its `extern` ABI must be one of those listed in [items.extern.variadic.conventions].
5754

5855
r[type.fn-pointer.attributes]
5956
## Attributes on function pointer parameters

0 commit comments

Comments
 (0)