That’s undefined behavior in C though:
https://news.ycombinator.com/item?id=3928788
back
1 comments
Your linked comment only quotes excerpts saying it's implementation-defined, rather than undefined. Can you point to the part that is undefined?
(You would use a uintptr_t for the xor'd prev-next pointers instead of void*.)
To be precise, it's implementation-defined whether it's undefined behavior, prior to C11. You are right that in C11, if uintptr_t is used to store the xored value, behavior is defined.
Implementation-defined whether it's UB or not is still implementation-defined, I think.
Which change are you thinking of in C11? (I'm just curious.) Thanks!