 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Vishal Guest
|
Posted: Tue Oct 28, 2003 5:28 am Post subject: why is intptr_t optional in C99? |
|
|
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
|
Posted: Tue Oct 28, 2003 9:00 pm Post subject: Re: why is intptr_t optional in C99? |
|
|
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
|
Posted: Tue Oct 28, 2003 9:00 pm Post subject: Re: why is intptr_t optional in C99? |
|
|
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 |
|
 |
Powered by phpBB © 2001, 2006 phpBB Group
|