Dunno - I tried something like it as well, and it compiles with MinGW.
Code:
#include <stdio.h>
#include <stdarg.h>
void ex ( int num, ... )
{
va_list arguments;
int x;
float (*p)(float);
va_start ( arguments, num );
for ( x = 0; x < num; x++ ) {
p = (float(*)(float))(va_arg(arguments,void*));
p = va_arg(arguments, float(*)(float) );
}
va_end ( arguments );
return;
}
int main ( ) {
return 0;
}
I might be tempted to go for the first one anyway. When you pass parameters in the ... positions, ALL type information is lost, and smaller types (short, char, float etc) are promoted to default long types (like int and double).
Similarly, on machines with variable sized pointers, they would have to be "promoted" to void*, and to extract them from a va_list, you would need to read them as void*, and then cast them back to the correct type.