All versions of varargs.h
and/or stdarg.h
I've seen either define va_end
as an empty macro or some opaque compiler-specific function that I guess doesn't do anything either. The rationale in the C standard states "some implementations might need it", but gives no more details.
When would there be a real need for a va_end()
? Any examples of ABI that would require such, preferably with an explanation?
va_end
should be called. Not my question (I know it should be called always--just in case it does something non-trivial). I'm curious what ABI would require a non-trivialva_end
. – Bikalesva_end
. The ABI doesn't actually specify how varargs are implemented. So the answer would be some implementation that stores the args not on the stack – Materialistva_end
would be needed. Maxim explains why x86-64 SysV needsva_copy
but notva_end
. James Curran just says "on platforms which have less traditional schemes, it becomes necessary" without elaborating which platforms or why. I am voting to reopen this. – Buggyalloca
. It might be forced to get it frommalloc
, and thenva_end()
could do thefree()
. – Buggy