On Monday, 15 June 2015 at 15:33:41 UTC, rsw0x wrote:

this doesn't make any sense, it's referring to an object p (of void*), not the location of p. It's setting the lsb of p to 1 and claiming it's undefined behavior, when it's clearly not.

Unless I misunderstand it.

`p` is assumed to be a pointer. `cast(int) p` gets the integer representation of the pointer (though it should be `uintptr_t` but whatever). It then does an integer bitwise or, then converts the result back to a pointer.

It's undefined behavior in D because the spec just said so (regardless of its defined behavior in C).

Reply via email to