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

Craig Dillabaugh craig.dillabaugh at gmail.com
Sun Nov 24 16:50:47 PST 2013


On Sunday, 24 November 2013 at 22:38:15 UTC, Jonathan M Davis 
wrote:
> On Sunday, November 24, 2013 17:15:25 Johannes Pfau wrote:
>> We have one type in D which has a different size depending on 
>> platform
>> and it's the number one source for platform-specific 
>> problems...
>
> 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.

Isn't size_t unsigned and ptrdiff_t signed?

>
> But it is true that a large portion of our platform-specific 
> problems stem from
> types that vary in size.
>
> - Jonathan M Davis



More information about the Digitalmars-d mailing list