va_arg question

Franz Sirl Franz.Sirl-kernel@lauterbach.com
Thu Jan 10 08:33:00 GMT 2002


At 15:42 10.01.2002, mgowan@lexmark.com wrote:


>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'?

Because va_arg only takes fully promoted types, that's what it was given by 
(...) as the error message clearly states. Use (char) va_arg(args,int) instead.

Franz.



More information about the Gcc mailing list