J
James Kuyper
Francis Moreau wrote:
....
Making it optional allows the existence of conforming implementations of
C99 on platforms where is not feasible to efficiently implement an
integer type large enough to store all distinct pointer values uniquely.
If it were made mandatory, this would not magically make it possible to
write code using uintptr_t on those platforms, it simply would mean that
compilers for those platforms wouldn't bother trying to fully conform to
the C99 standard.
That's essentially the same thing that can be said about any of the
other optional types, such as uint32_t. Making it mandatory wouldn't
make it possible to write code which uses uint32_t on a 36-bit platform,
it would simply mean that there would be no fully conforming
implementation of C99 for such platforms.
Implementation leave out optional types are only left out because they
can't be implemented, not because the implementors are too lazy to add
the appropriate typedef. <stdint.h> is one of the easiest headers to
implement in the standard library.
....
That's true. But 'uintptr_t' type is optional and I'm still wondering
the point to make it _optional_ since it makes it almost useless.
Making it optional allows the existence of conforming implementations of
C99 on platforms where is not feasible to efficiently implement an
integer type large enough to store all distinct pointer values uniquely.
If it were made mandatory, this would not magically make it possible to
write code using uintptr_t on those platforms, it simply would mean that
compilers for those platforms wouldn't bother trying to fully conform to
the C99 standard.
That's essentially the same thing that can be said about any of the
other optional types, such as uint32_t. Making it mandatory wouldn't
make it possible to write code which uses uint32_t on a 36-bit platform,
it would simply mean that there would be no fully conforming
implementation of C99 for such platforms.
Implementation leave out optional types are only left out because they
can't be implemented, not because the implementors are too lazy to add
the appropriate typedef. <stdint.h> is one of the easiest headers to
implement in the standard library.