In C++ why have va_start immediately followed by va_end?

  c++, variadic-functions

I see the following code in a few functions in a project I am trying to read and understand:

void Algo::descend(const enc_node* node, const char* option, ...)
{
    ...
    va_list va;
    va_start(va, option);
    va_end(va);
    ...
}

I understand variadic functions in principle but why would someone make a variadic function and then call va_start() followed immediately by va_end() with nothing in between? What does this achieve?

Source: Windows Questions C++

LEAVE A COMMENT