March 29, 2020
On Saturday, 28 March 2020 at 19:11:04 UTC, Johan wrote:
> On Saturday, 28 March 2020 at 15:23:19 UTC, Stefan Koch wrote:
>>
>> cast (ubyte)x is the same as = ((cast(uint)x) & 0xff)
>
> Where does the spec say that?
>
It's a consequence of the int promotion rule D adheres to.


March 29, 2020
On 28.03.20 16:33, kinke wrote:
> that should probably be explicitly mentioned as undefined behavior, to account for the observed LLVM/gcc behavior.

It can't be full-blown UB as such a cast works in @safe code.
1 2
Next ›   Last »