size_t + ptrdiff_t

Manu turkeyman at gmail.com
Mon Feb 20 14:34:36 PST 2012


On 20 February 2012 21:51, Sean Kelly <sean at invisibleduck.org> wrote:

> On Feb 20, 2012, at 11:43 AM, Manu wrote:
>
> > On 20 February 2012 19:21, Iain Buclaw <ibuclaw at ubuntu.com> wrote:
> >
> > OK, I'm just having a trudge through druntime:
> >
> > intptr_t and uintptr_t are guaranteed to match pointer size.
> >
> https://bitbucket.org/goshawk/gdc/src/87241c8e754b/d/druntime/core/stdc/stdint.d#cl-70
> >
> > c_long and c_ulong are guaranteed to match target long size (here
> > would also go c_int and c_uint ;-).
> >
> https://bitbucket.org/goshawk/gdc/src/87241c8e754b/d/druntime/core/stdc/config.d#cl-22
> >
> > This needs fixing, as wchar_t may not be same size across all targets
> > (some change size of wchar_t based on compile time switches).
> >
> https://bitbucket.org/goshawk/gdc/src/87241c8e754b/d/druntime/core/stdc/stddef.d#cl-28
> >
> > This needs fixing, as wint_t may not be same size across all targets.
> >
> https://bitbucket.org/goshawk/gdc/src/87241c8e754b/d/druntime/core/stdc/wchar_.d#cl-29
> >
> > --
> > Iain Buclaw
> >
> > *(p < e ? p++ : p) = (c & 0x0f) + '0';
> >
> > It seems the problem is already MUCH worse than in D already :( .. this
> was precisely my fear.
> > Why all these redundant aliases? Just for C compatibility?
>
> core.stdc is an interface to the C99 API, so everything is preserved
> verbatim.  c_long and c_ulong were added because the size of C long differs
> between Windows and non-Windows x86_64 platforms.  Typically, int, short,
> etc are the same however, which is why there's currently no c_int--it was
> just a needless complication at the time.  The aliases for D users, if the
> exist at all, should be separate.


What about intptr_t/uintptr_t, are they builtins, or in core.stdc?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120221/f88d405f/attachment-0001.html>


More information about the Digitalmars-d mailing list