This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

va_arg question




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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]