I just ran into a smallish issue when working with size_t values in some code.
First I wanted to use size_t because it's [guaranteed] to be the same size on most platforms, that way going from 32 to 64 bit shouldn't cause any issues.
Then I negated the size_t value and got a really big number, looking back I realized that size_t is unsigned. There is intptr_t which is also signed but should be used for pointers and there's uintptr_t which is unsigned and also used for pointers.
My eventual goal is to implement a simple set of fixed point math functions in c.
My question is can I use uintptr_t like an int in all my calculations? Could that cause any issues?