J
Jerry Coffin
[ ... ]
C99, section 7.17/2 contains almost identical wording to that from
the C90 standard, saying that size_t is: "the unsigned integer type
of the result of the sizeof operator;"
The only difference is that "integral" has been changed to "integer".
There is one fundamental change, however: C99 has the "standard
unsigned integer types", which are basically synonymous with what C90
called the unsigned integer types. It also, however, has the
possibility of "extended unsigned integer types", which are
implementation defined. The "unsigned integer types", are basically a
union of the standard and extended unsigned integer types.
That means in C99, and presumably C++ 0x, size_t might not be a
synonym for any standard type. I guess, in theory, it doesn't
restrict extended unsigned integer types to types that are unsigned
or integers, so (in theory) somebody could define "double" as being
an extended unsigned integer type -- but even as strict as I am about
interpreting the standard only for what it requires and not what it
almost certainly means, it's hard for even me to imagine anybody
defining something as an "extended unsigned integer" unless it truly
is 1) unsigned, and 2) an integer type.
In C99, size_t does not have to be a synonym for an
integral type (although it does in C90, as you point out).
C99, section 7.17/2 contains almost identical wording to that from
the C90 standard, saying that size_t is: "the unsigned integer type
of the result of the sizeof operator;"
The only difference is that "integral" has been changed to "integer".
There is one fundamental change, however: C99 has the "standard
unsigned integer types", which are basically synonymous with what C90
called the unsigned integer types. It also, however, has the
possibility of "extended unsigned integer types", which are
implementation defined. The "unsigned integer types", are basically a
union of the standard and extended unsigned integer types.
That means in C99, and presumably C++ 0x, size_t might not be a
synonym for any standard type. I guess, in theory, it doesn't
restrict extended unsigned integer types to types that are unsigned
or integers, so (in theory) somebody could define "double" as being
an extended unsigned integer type -- but even as strict as I am about
interpreting the standard only for what it requires and not what it
almost certainly means, it's hard for even me to imagine anybody
defining something as an "extended unsigned integer" unless it truly
is 1) unsigned, and 2) an integer type.