On Wed, 10 May 2000, Doug Rabson wrote:
> On Wed, 10 May 2000, Simon Shapiro wrote:
> > It actually worked! Now I will go and see what this uintptr_t
> > actually is :-)
>
> Its an unsigned integer type which is the same size as a pointer (i.e. its
> safe to cast a pointer to uintptr_t without losing information).
Actually, it is only guaranteed that casting a void * to uintptr_t doesn't
lose information, and the size of uintptr_t may be anything that works.
>From the C99 draft (n869.txt):
7.18.1.4 Integer types capable of holding object pointers
[#1] The following type designates a signed integer type
with the property that any valid pointer to void can be
converted to this type, then converted back to pointer to
void, and the result will compare equal to the original
pointer:
intptr_t
The following type designates an unsigned integer type with
the property that any valid pointer to void can be converted
to this type, then converted back to pointer to void, and
the result will compare equal to the original pointer:
uintptr_t
These types are optional. |
[C99 has standard macros which can be used in ifdefs to determine whether
optional types exist. Optional types should exist if they can exist.
FreeBSD doesn't support C99, but uintptr_t exists for all supported
arches. The C00 macros to support it are not implemented.]
Bruce
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message