[Issue 1257] Erroneous warning for ushort = (ushort | ushort)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Sep 26 22:18:10 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=1257





------- Comment #2 from andrei at metalanguage.com  2008-09-27 00:18 -------
(In reply to comment #1)
> I've been bitten by this too. Simple operations like assigning the sum of two
> shorts to another short give warnings; I've had to shut them off as a
> workaround.

I think the sum of any integrals smaller than int/uint should result in
int/uint, so that warning is legit in that case. The reason is a mix of being
principled (operations should avoid overflow) and being practical (int won't
spill into long). Bitwise operations should indeed preserve size.


-- 



More information about the Digitalmars-d-bugs mailing list