The lastfirst two calls that you show are undefined behavior according to the C standardstandard; only the call that passes the last named parameter is correct. However, you get good behavior on gcc, because gcc compilers ignore the second parameter of va_start, using a different technique to find the end of the argument list:
The traditional implementation takes just one argument, which is the variable in which to store the argument pointer. The ISO implementation of
va_starttakes an additional second argument. The user is supposed to write the last named argument of the function here. However,va_startshould not use this argument. The way to find the end of the named arguments is with the built-in functions described below {link}.