The Linux kernel `container_of` and `offset_of` macros can be pretty handy when writing generic containers.
Both of those are actually rather simple macros doing what seems like a mess with pointers. The difference is subtle, but most strongly expressed in that the complexity is innate to the problem, and does not require mucking much with what is entirely weird macro behavior.