On Mon, 4 Sept 2023 at 12:18, Andreas Schwab wrote: > > > + loadoff = (uintptr_t)segment->p_vaddr - > > + (uintptr_t)segment->p_offset; > > Shouldn't that use a signed difference, then? Since loadoff is now > ptrdiff_t, I would expect the use of ptrdiff_t for the casts. > Hi, For the 32-bit code, we were previously relying on the behaviour of wrap-around on the unsigned type, this just extends that reliance to a pointer-sized integer on the 64 bit platform. I guess intptr_t might be a better option than uintptr_t? I would think ptrdiff_t would really only be useful as the difference between two pointers (and I guess if you want to be pedantic, might not always be the same as the size of a pointer).