C4244 Warning with +=



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?
.



Relevant Pages

  • Re: trusted-users ignored
    ... To get rid of it I inserted ... The warning is produced by the message submission program, ... Prev by Date: ...
    (comp.mail.sendmail)
  • @SuppressWarnings("unchecked") not working
    ... I thought I could get rid of those ... warning: unchecked conversion ... but still get the warning when compiling with -Xlint:unchecked. ... Prev by Date: ...
    (comp.lang.java.programmer)
  • Desktop screens gone...
    ... I had this spyware download onto my computer -AvGold- It took over my desktop ... and made it black with a warning sign and could not get rid of it. ... Prev by Date: ...
    (microsoft.public.windowsxp.general)
  • Re: Trial Expired Warning With OEM office installed.
    ... I dont need to uninstall office, I just need to get rid of the trial warning. ... OEM version with the same results. ...
    (microsoft.public.office.misc)
  • Re: "Your computer has been infected with malware" windows update
    ... removers and most of them come back clean or have removed the stuff they ... now how do I get rid of this warning. ... > Use noahdfear's SmitFraud and SpyAxe removal tool -- SmitRem.exe ...
    (microsoft.public.windowsxp.perform_maintain)

Loading