Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 May 2000 07:53:27 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Doug Rabson <dfr@nlsystems.com>
Cc:        Simon Shapiro <shimon@simon-shapiro.org>, freebsd-current@FreeBSD.ORG, obrien@FreeBSD.ORG, Mike Smith <msmith@FreeBSD.ORG>
Subject:   Re: One more question (different now)
Message-ID:  <Pine.BSF.4.21.0005110740280.10531-100000@besplex.bde.org>
In-Reply-To: <Pine.BSF.4.21.0005102042580.47945-100000@salmon.nlsystems.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0005110740280.10531-100000>