[Issue 1535] incorrect casting of 8 bit quantities to longer precision

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Sep 27 18:43:27 PDT 2007


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


shro8822 at vandals.uidaho.edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




------- Comment #1 from shro8822 at vandals.uidaho.edu  2007-09-27 20:43 -------
I think this bug is invalid:

byte should get sign extended as it is a signed value (ubyte is unsigned).
char is not technically a number so I'm not sure what should happen when it is
cast to an int. (or short, or long, etc.) When it is cast to a large char
(wchar or dchar) it should be converted to the equivalent value there (which
bitwise is IIRC the same as a unsigned cast from a ubyte to ushort or uint)
based on that the cast is correct in both cases.

I;m marking this as invalid because one cases is invalid and the other probably
is.


-- 



More information about the Digitalmars-d-bugs mailing list