I searched quite a bit, but could not find anything useful - but then I am not sure that I was looking for the right thing.
Is there any scalar defined by the standard that should be at least as large as the pointer? That is, sizeof (?)> = Sizeof (void *).
I need this because I am writing a small garbage collector and want something like this:
struct Tag { uint32_t desc:sizeof(uint32_t)*8-2;
I would prefer something valid according to the standard (if we are on it, I was very surprised that sizeof (uint32_t) * 8-2 is valid for determining the bit field, but VS2010 allows this).
So size_t fulfills this requirement?
Edit: So, after my inclusion of C and C ++ leads to some problems (well, there I thought they would be similar in this respect), I would really agree to one of them (I don't need C ++ for this part of the code, and I can bind C and C ++ together to make them work). And C99 seems to be the right standard in this case from the answers.
source share