Re: C4244 Warning with +=
- From: "Igor Tandetnik" <itandetnik@xxxxxxxx>
- Date: Fri, 26 Aug 2005 10:22:15 -0400
Matt <Matt@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> I'm compiling my code with warning level 4 and i am getting C4244
> warnings: conversion from 'int' to 'unsigned short', possible loss of
> data on code like this:
>
> WORD w1 = 5;
> WORD w2 = 2;
>
> w1 += w2; // <--- generates warning
>
> Both types match - how can i get rid of this warning?
This was discussed at some length, e.g. here
http://groups.google.com/group/microsoft.public.vc.language/browse_frm/thread/95ecc316830c1562/a713ae3345f0c810
http://groups.google.com/group/microsoft.public.vc.language/browse_frm/thread/d95905585ebf6d7c/71dab3957a027827
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
.
- Follow-Ups:
- Re: C4244 Warning with +=
- From: Matt
- Re: C4244 Warning with +=
- References:
- C4244 Warning with +=
- From: Matt
- C4244 Warning with +=
- Prev by Date: Re: SSL / SSH connection ??
- Next by Date: Re: VC 6 compil DLL used by VC7
- Previous by thread: C4244 Warning with +=
- Next by thread: Re: C4244 Warning with +=
- Index(es):
Relevant Pages
|