This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: va_arg question
- From: Franz Sirl <Franz dot Sirl-kernel at lauterbach dot com>
- To: mgowan at lexmark dot com
- Cc: gcc at gcc dot gnu dot org,mgowan at lexmark dot com,rivers at lexmark dot com
- Date: Thu, 10 Jan 2002 16:15:05 +0100
- Subject: 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.