I agree it's a yucky part of the standard, but there probably wasn't
much choice at the time. It would seem ok change it now though.
On really old compilers va_arg is implemented as _ordinary_ C code.
Even though the code is compiler specific, there is no way for it to do
what you'd like. It can't conditionalise on sizeof() because
sizeof(int) == 4 == sizeof(float) (sometimes). It can't do stringifying
things on the type name because of typedefs. sizeof(type + 0) gets
pretty close to supplying the pointer tweaking details, but doesn't work
on void * (the only exception I can think of).
I think GCC actually does do what you want, except for some machine
descriptions there's a bug. I think I saw an EGCS thread about it.
-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/