C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

why is intptr_t optional in C99?

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C Language (Moderated)
View previous topic :: View next topic  
Author Message
Vishal
Guest





PostPosted: Tue Oct 28, 2003 5:28 am    Post subject: why is intptr_t optional in C99? Reply with quote



Are there any platforms on which it is not possible to define intptr_t?

Thanks,
Vishal
--
comp.lang.c.moderated - moderation address: [email]clcm (AT) plethora (DOT) net[/email]
Back to top
Douglas A. Gwyn
Guest





PostPosted: Tue Oct 28, 2003 9:00 pm    Post subject: Re: why is intptr_t optional in C99? Reply with quote



Vishal wrote:
Quote:
Are there any platforms on which it is not possible to define intptr_t?

It's always *possible* if the implementor decides to do so,
but that might involve an unacceptable trade-off. Consider
a system that uses addresses that encode protection rings
and maybe other information that is outside the abstract C
machine model but still is necessary for the implementation
of pointers to be efficient enough. Quite possibly the
machine data word size used to represent integers is too
small to hold the data from such a pointer without loss of
information. Rather than requiring every C implementation
to always provide this facility, which after all is not one
that ought to be used in portable programs, the standard
merely provides a standard way to make such conversions on
platforms where they are readily supported.
--
comp.lang.c.moderated - moderation address: [email]clcm (AT) plethora (DOT) net[/email]

Back to top
Dan Pop
Guest





PostPosted: Tue Oct 28, 2003 9:00 pm    Post subject: Re: why is intptr_t optional in C99? Reply with quote



In <clcm-20031027-0004 (AT) plethora (DOT) net> Vishal <vcmpk (AT) yahoo (DOT) com> writes:

Quote:
Are there any platforms on which it is not possible to define intptr_t?

Any platform with very wide pointers may have problems providing intptr_t.
AS/400 comes to mind.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: [email]Dan.Pop (AT) ifh (DOT) de[/email]
--
comp.lang.c.moderated - moderation address: [email]clcm (AT) plethora (DOT) net[/email]

Back to top
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C Language (Moderated) All times are GMT
Page 1 of 1

 
 


Powered by phpBB © 2001, 2006 phpBB Group