RE: [GD-Windows] Compiler code gen
Brought to you by:
vexxed72
From: Paul B. <pa...@wi...> - 2004-11-30 00:45:11
|
> -----Original Message----- > From: gam...@li...=20 > To: gam...@li... > Subject: Re: [GD-Windows] Compiler code gen >=20 > I changed my va_arg(ap, float) to va_arg(ap, double) and it=20 > works now.=20 > Thanks! I think it's questionable that CodeWarrior doesn't=20 > do the right thing when retrieving a float from from va_arg,=20 > but maybe they have a good reason for doing it that way... > Cheers, > Brett=20 As was noted before, this is part of the default argument promotions that C and C++ define as standard. This is more explicit in the ANSI C standard (search for "default argument promotions" in your favorite ANSI C spec). The C++ version handwaves a bit when it comes to the float, int, and enum promotions but (I think) the behavior is the same. Paul |