Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C > Re: pointer to ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 13 Topic 26086 of 26977
Post > Topic >>

Re: pointer to integer to pointer conversions

by rlb@[EMAIL PROTECTED] (Richard Bos) May 7, 2008 at 08:17 AM

Eric Sosman <esosman@[EMAIL PROTECTED]
> wrote:

>      C99 improves the situation, but only a little.  If the integer
> types intptr_t and uintptr_t exist, then any valid void* can be
> converted to one of them and back again and survive the journey.
> (There are no guarantees for invalid pointers, nor for converting
> an arbitrary integer value to void* and back.)  Note, though, that
> these integer types are optional: If they exist they will work as
> you desire, but on some "exotic" architecture they might be absent.

On the upside, if your architecture is exotic enough that it has a C99
implementation but no (u)intptr_t, it's probably not reliably possible
to do this in the first place. So if including <stdint.h> doesn't result
in a definition of UINTPTR_MAX, bailing out with an #error would
probably have been your best option anyway.

BTW, I still don't understand why we have both intptr_t and uintptr_t.
We really only need either of those.

Richard
 




 13 Posts in Topic:
pointer to integer to pointer conversions
lithiumcat@[EMAIL PROTECT  2008-05-06 05:05:39 
Re: pointer to integer to pointer conversions
vippstar@[EMAIL PROTECTED  2008-05-06 05:34:20 
Re: pointer to integer to pointer conversions
Eric Sosman <esosman@[  2008-05-06 08:37:09 
Re: pointer to integer to pointer conversions
rlb@[EMAIL PROTECTED] (R  2008-05-07 08:17:12 
Re: pointer to integer to pointer conversions
"Stephen Sprunk"  2008-05-07 16:37:01 
Re: pointer to integer to pointer conversions
Keith Thompson <kst-u@  2008-05-07 15:45:19 
Re: pointer to integer to pointer conversions
lithiumcat@[EMAIL PROTECT  2008-05-06 08:33:00 
Re: pointer to integer to pointer conversions
Keith Thompson <kst-u@  2008-05-06 12:46:11 
Re: pointer to integer to pointer conversions
Flash Gordon <spam@[EM  2008-05-06 21:42:38 
Re: pointer to integer to pointer conversions
vippstar@[EMAIL PROTECTED  2008-05-07 06:54:46 
Re: pointer to integer to pointer conversions
Peter Nilsson <airia@[  2008-05-07 15:30:26 
Re: pointer to integer to pointer conversions
rlb@[EMAIL PROTECTED] (R  2008-05-08 12:52:49 
Re: pointer to integer to pointer conversions
Peter Nilsson <airia@[  2008-05-07 15:44:02 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 3:54:14 CDT 2008.