Re: Upstream asks: unportable patch for mirrormagic?
Hi Michael,
> > > > - gi->checked = va_arg(ap, boolean);
> > > > + gi->checked = (boolean) va_arg(ap, int);
[...]
> Nope, this patch makes va_arg get the proper arguments in the first place.
> va_arg may only be called with the data type argument being one of the
> data types after default type promotion (char -> int, float -> double).
You're right, of course -- I should have read the man-page more carefully,
although it's a bit hidden there (in the "EXAMPLES" section):
/* need a cast here since va_arg only
takes fully promoted types */
c = (char) va_arg(ap, int);
That's the exact situation as above.
I'll change this accordingly.
Best regards,
Holger
--
holger.schemel@mediaways.net
Reply to: