▲ | wavemode 2 days ago | |||||||||||||
I don't think pointer tagging (in and of itself, when implemented correctly for a particular platform) is ever undefined behavior. Rather, it is implementation-defined behavior - the result of converting a pointer to an integer is not specified, and could in theory be anything, so you have to know how your compiler and platform behave. | ||||||||||||||
▲ | RossBencina 2 days ago | parent [-] | |||||||||||||
We pray that it is implementation defined. According to some [1] even arithmetic on intptr_t is UB, let alone bit operations. | ||||||||||||||
|