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]

Re: va_arg question


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.


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