[dmd v2.066.0-b2] Some functions no longer accept ulong

Issue #1 resolved
Stefan Frijters created an issue

I'm currently testing my code, which uses unstd, with the v2.066.0-b2 version of dmd/druntime/phobos and I'm now getting errors of the form

src/unstd/memory/allocation.d(630): Error: None of the overloads of 'alignUp' are callable using argument types (const(ulong), ulong), candidates are: src/unstd/math.d(140): unstd.math.alignUp(const(uint) alignment, const(uint) n)

when compiling unstd (everything was working fine with a DMD stack from 2014-05-16). My guess is some change in DMD and friends now disallows some implicit casts? Similar errors are obscured; I tried changing the parameter types to size_t and I needed to change a bunch of functions to make everything compile, but I'm not sure this doesn't break anything else...

Comments (5)

  1. Denis Shelomovskii repo owner

    Sorry for that, it's an old known issue. unstd.math functions accept uint but often called for size_t and will fail if size_t is ulong (unless there is a compiler bug somewhere). I just failed to create a good design when I created that module.

    Thanks for the report, it will be fixed in 24 hours.

  2. Denis Shelomovskii repo owner

    [Fix] Use size_t instead of uint as parameter type in unstd.math functions.

    unstd.math functions accept uint parameters but are often called for size_t and thus will fail if size_t is ulong.

    Fixes bug #1.

    → <<cset 55cbe4eebb67>>

  3. Log in to comment