dmd 1.046 and 2.031 releases

BCS ao at pathlink.com
Thu Jul 16 10:29:57 PDT 2009


Reply to bearophile,

> 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

I'm going with Steven on this one. Making the legality of code dependent 
on it's semantics is risky because it then ends up with bazaar portability 
issues or requiters that the scope of the semantics analysts engine be part 
of the language spec.




More information about the Digitalmars-d-announce mailing list