va_arg question
mgowan@lexmark.com
mgowan@lexmark.com
Thu Jan 10 07:30:00 GMT 2002
Hello,
I built a PowerPC cross compiler using gcc 3.0.2. I'm having trouble with the
va_arg macro (or __builting_va_arg as it's typedefed to in stdarg.h). The
problem is a compile error I get when trying to pass a data type smaller that 32
bits to the TYPE parameter of va_arg. Why won't va_arg take values like 'short'
and 'char'? This little chunk of code will demonstrate the error:
/* cut and paste from here */
void subr() {
typedef __builtin_va_list va_list;
va_list args;
__builtin_va_arg(args, char); /* this will fail */
__builtin_va_arg(args, short); /* this will fail */
__builtin_va_arg(args, int); /* this will work */
__builtin_va_arg(args, long long); /* this will fail */
}
/* end of code */
Thanks,
Mike Gowan
More information about the Gcc
mailing list