by petabyt · 2y ago · 0 comments
Calling varargs functions over FFI has been possible since before Rust 1.0, here's printf, for example https://docs.rs/libc/latest/libc/fn.printf.html
(If you wrote to an array on the stack, you could turn it into a Cstr too, instead of heap allocating, but then you'd have a max string size, which may or may not be something you'd want.)