'int' is enough for 'length' to migrate code from x86 to x64

Ary Borenszweig via Digitalmars-d digitalmars-d at puremagic.com
Wed Nov 19 19:06:27 PST 2014


On 11/19/14, 9:54 PM, FrankLike wrote:
>> How is that a bug? Can you provide some code that exhibits this?
>
> If you compile the dfl Library to 64 bit,you will find error:
>
> core.sys.windows.windows.WaitForMultipleObjects(uint
> nCount,void** lpHandles,....) is not callable using argument
> types(ulong,void**,...)
>
> the 'WaitForMultipleObjects' Function is in
> dmd2/src/druntime/src/core/sys/windows/windows.d
>
> the argument of first is dfl's value ,it comes from a 'length'
> ,it's type is size_t,now it is 'ulong' on 64 bit.
>
> So druntime must keep the same as  phobos for size_t.
> Or  keep the same to int with WindowsAPI to  modify the size_t to int ?

Sorry, maybe I wasn't clear. I asked "how a negative length can be a bug".

(because you can't set a negative length, so it can't really happen)


More information about the Digitalmars-d mailing list