Simply, you cannot do it.
sizeof won't work, because sizeof (short) might be 1, or sizeof (float) == sizeof (long).
It's simply impossible just with the size.
Also, sizeof (size_t) might be 4 in your system but 128 in others.
one thing you can do if you know you work with integers and pointers only is to use intmax_t, but I'm not sure if that is what you were looking for.