Why is it that no one writes with portability in mind in druntime?

Joseph Rushton Wakeling joseph.wakeling at webdrake.net
Mon Nov 25 00:25:46 PST 2013


On 24/11/13 23:38, Jonathan M Davis wrote:
> No. We have several types which vary in size. In addition to real, there's
> also size_t (which should be being used in almost all D programs, whereas real
> is used in far fewer), and there's also ptrdiff_t, which is effectively an
> unsigned size_t. And of course, all of the pointer types vary in size, as do
> the c_* types from druntime when you have to interact with C (though those
> aren't part of the language - or even just treated as part of the language as
> size_t and ptrdiff_t are, since they're defined in object_.d). So, even if
> almost all of D's numeric types don't vary in size, there are some that do.

But ... am I not right that size_t and ptrdiff_t are essentially just defined as 
aliases to either ulong and long (for 64-bit) or uint and int (32-bit) code?  So 
don't you essentially get support for them "for free" just by supporting 32- and 
64-bit integral types?  Or are there still problems that arise?


More information about the Digitalmars-d mailing list