I wonder if this yields in undefined behaviour:
printf("Test %d %s", 123, "abc", "def", "ghi");
The first two arguments after the format string match the format string, so these are OK; but the 3rd and 4th arguments are in excess because there are no more corresponding format specifiers.
IMHO printf()
should simply ignore these excess arguments and there should be no UB. Is this correct?