Re: [GD-Windows] VC 2005 Warning C4244
Brought to you by:
vexxed72
From: Jeff G. <jef...@ho...> - 2007-12-13 20:51:13
|
You can disable the warning using a #pragma: =20 #pragma warning(disable : 4244)//double to floatenjoy =20 =20 =20 > Date: Wed, 12 Dec 2007 21:56:34 +1000> From: dan...@gm...> T= o: gam...@li...> Subject: [GD-Windows] VC 200= 5 Warning C4244> > G'Day,> I'm trying to compile at warning level 4 and I'm= getting a lot of> spurious C4244. This warning is about an integer narrow = storing> possibly loosing information.> > The problem is with this kind of = code:> > u_short n =3D htons(x);> > htons returns a u_short but, as the sta= ndard says, the result of> integer expressions is promoted to int (or unsig= ned) and is causing> the warning. Is there anyway I can code it to shut up = VC 2005?> > u_short n =3D (u_short)htons(x) doesn't work, because the resul= t is> still promoted in the context of an expression!> > cheers> DanG> > --= > Dan Glastonbury, Dan dot Glastonbury at gmail dot com> `Pour encourjay l= ays ortras'> > ------------------------------------------------------------= -------------> SF.Net email is sponsored by:> Check out the new SourceForge= .net Marketplace.> It's the best place to buy or sell services for> just ab= out anything Open Source.> http://sourceforge.net/services/buy/index.php> _= ______________________________________________> Gamedevlists-windows mailin= g list> Gam...@li...> https://lists.sourcefor= ge.net/lists/listinfo/gamedevlists-windows> Archives:> http://sourceforge.n= et/mailarchive/forum.php?forum_id=3D555 _________________________________________________________________ Get the power of Windows + Web with the new Windows Live. http://www.windowslive.com?ocid=3DTXT_TAGHM_Wave2_powerofwindows_122007= |