On calling variadic C functions

Ohh, I see. Yeah, that makes sense (also, while we're at it: dangit, C is so unsafe! More than I already knew!).

For the compiler help, I think this is acceptable:

  • Happy path: compiler finds the non-variadic variant (send ~> sendv for C, <something something>, arguments: for ObjC). Then it recommends trying it instead and points out to the docs.
  • Normal path: compiler says there's maybe a non-variadic form of the function, and points out to the docs.
  • (maybe) At all paths: point out to somewhere in the docs where we say why variadic C functions aren't imported in Swift. That document explains what you've told me and gives some alternatives (like looking for functions that accept va_list).
1 Like