Steven Schveighoffer <> changed:

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

--- Comment #2 from Steven Schveighoffer <> ---
This is recent, and as designed.

Please see:

See the original bug report here:

Note that in C:

unsigned char x = 0x80;
int y = ~x; // 0xffffff7f

In D, without any switches:

ubyte x = 0x80;
int y = ~x; // 0x0000007f

With the intpromote switch, it's the same as C. This is the point behind the
change -- it was a bug that the integer promotion didn't happen before the

Yes, in C, you don't have to cast an int back down to unsigned char explicitly,
it just truncates without complaint. D does not. This is the difference you are
seeing that requires the cast.


Reply via email to