On calling variadic C functions

It was a deliberate decision not to support arbitrary C variadic functions in Swift, since they are not type-safe and not composable, and don't have a good way to represent them in today's type system. (Never mind that you can't compose variadic Swift functions at the moment either, because we don't have forwarding…)

I agree that it would be nice to point the user towards withVaList if there is in fact a related function that takes a va_list/CVaList, but we'd have to be pretty confident in how the compiler finds such a "related" function before we suggest it. (The "v" suffix is pretty good for C functions; arguments: is frequently used for Objective-C methods.)

1 Like