2026-11-04 17:20 UTC
say i have some hardware mmio structure, that has two fields for a pointer, hi and lo
is it defined behavior in c to:
cast my pointer to uintptr_t
split it and assign across those two fields
and later in another function:
bitwise join the two fields in a uintptr_t
cast the result back to the original pointer type that i've allocated beforehand
since the value representation should be the same after rebuilding the uintptr, and uintptr is defined as surviving roundtrips, i think it's all good?
Replies (1)
-
@joe@f.duriansoftware.com 2026-11-04 20:09
@navi@social.vlhl.dev yep