it's uintptr_t which should be used, if only as an intermediate cast -
(unsigned long)(uintptr_t)ptr.
That's not possible because, IIRC, gcc must compile on C90 systems.
Right, so the only type remaining is size_t. IIRC there is problem for
this type on some targets, too. AFAIC there are 24-bit pointers ...
This is the reason, why I was querying to introduce a new general type for
such stuff in gcc.
size_t is ok I think, but just in case, there is an autoconf macro (used
in libgfortran and libdecnumber) that provides int*_t.
Paolo