0

I want to create a union of 2 pointers which have 1 byte alignment, but I don't want to store an additional tag, to distinguish them. I know that on some platforms, at least the most significant bit of a pointer is unused, but that might change in the future.

Please does someone know a portable way to do this?

I'm hoping for a technique that does not invalidate the original pointer. That is, is there a function for which when I apply it to some number n, frees up at least one bit in the number and when I "unapply" it, gives me back the original number.

user207421
  • 305,947
  • 44
  • 307
  • 483

0 Answers0