public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* std::size_t and pointer size in C++ (was Re: [Patch]: ggc-page.c: use uintptr_t instead of size_t)
@ 2012-03-20 15:25 Václav Zeman
  0 siblings, 0 replies; only message in thread
From: Václav Zeman @ 2012-03-20 15:25 UTC (permalink / raw)
  To: gcc-help

I have noticed the following email in gcc-patches:

On 20 March 2012 10:41, Tristan Gingold wrote:
> Hi,
>
> ggc-page.c uses size_t to cast pointers to an integer type.  Unfortunately, this isn't portable for systems (such as … VMS) where size_t precision is less than pointers precision.
>
> Fortunately, thanks to configure, uintptr_t type is always present, so this path simply replaces size_t by uintptr_t for such conversions (but still keeping size_t for size expressions).
>[...]

This is interesting for me from C++ library author point of view. I
have always silently (without support in the ISO standard) assumed
that std::size_t is the same or bigger width than data pointers. This
is true for all platforms I have ever worked with. But I have never
worked with VMS. So, the question is: Is there a native C++ type that
is the same bit width as pointers on VMS? Maybe std::ptrdiff_t?

-- 
VZ

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-03-20 15:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-20 15:25 std::size_t and pointer size in C++ (was Re: [Patch]: ggc-page.c: use uintptr_t instead of size_t) Václav Zeman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).