Yes, each call to va_start
must be matched by a va_end
. I don't think it's necessary to know the implementation detail.
C11 §7.16.1 Variable argument list access macros
The va_start
and va_arg
macros described in this subclause shall be implemented as macros, not functions. It is unspecified whether va_copy
and va_end
are macros or identifiers declared with external linkage. If a macro definition is suppressed in order to
access an actual function, or a program defines an external identifier with the same name,
the behavior is undefined. Each invocation of the va_start
and va_copy
macros shall be matched by a corresponding invocation of the va_end
macro in the same function.
It's the same in C++.