by fsckboy · 2y ago · 0 comments
the aforementioned comment from TFA:
C99's addition of va_copy to the variadic argument API may give us a back door to Turing-completeness. Since it becomes possible to iterate through a variadic arguments list more than once in a function other than the one that originally received the arguments, va_args can be used to implement a pointerless pointer.
Of course, a real implementation of the variadic argument API is probably going to have a pointer somewhere, but in our abstract machine it can be implemented using magic instead.
[1] Whether that copy is meaningfully usable is a different matter, which is why va_copy exists.