Ben Bacarisse <> writes:
[...]
> BTW, does anyone know why trailing object pointers are not converted
> to void * when calling a function with a (xxx, ...) prototype? It
> seems the logical choice to me.
scanf() and friends need to accept arguments of type int*, long*,
double*, and so forth.
I suppose the int* argument could be converted to void*, and then
scanf could convert it back to int* internally.
But I think it's mostly just historical practice. printf and scanf
existed before the ", ..." / <stdarg.h> mechanism was invented, and
functions that needed to take variable numbers of arguments just
traversed memory to get at them. The caller was just expected to pass
the expected type.
--
Keith Thompson (The_Other_Keith)
kst- <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"