dmd 1.046 and 2.031 releases

bearophile bearophileHUGS at lycos.com
Thu Jul 16 06:38:37 PDT 2009


John C:
> Did you not read the change log?
> "Implicit integral conversions that could result in loss of significant bits are no longer allowed."

This was the code:
ubyte m = (n <= 0 ? 0 : (n >= 255 ? 255 : n));

That last n is guaranteed to fit inside an ubyte (yes, I understand the compiler is not smart enough yet to understand it, but from the things explained by Andrei I have thought it was. So I am wrong and I have shown this to other people, that may be interested. I have also encouraged to make the compiler smarter to avoid a cast in such case, because this is a single expression, so range propagation is probably not too much hard to implement given the current design of the front-end. You have missed most of the purposes of my post).

Bye,
bearophile


More information about the Digitalmars-d-announce mailing list