Old code no longer working on any DMD compilers

Jamie notme at gmail.com
Fri Sep 6 00:24:07 UTC 2019


I just picked up some of my old code that was working when I last 
used it (approximately 6 months ago) but now is no longer 
working. I thought it was due to using an updated compiler, so I 
have installed many old compilers in and attempt to make it work, 
but no luck. Using DVM I have tried 2.077.0, 2.078.0, 2.079.0, 
2.087.0, 2.088.0, and I think I was using 2.079.0 at the time, 
but none of these have worked. The actual issue is:

/home/jamie/.dvm/compilers/dmd-2.077.0/linux/bin/../../src/phobos/std/math.d(3702): Error: fmodl cannot be interpreted at compile time, because it has no available source code
called from here: called from here: fmod(cast(real)to(n), 
cast(real)to(2))

and

/home/jamie/.dvm/compilers/dmd-2.077.0/linux/bin/../../src/druntime/import/object.d(3067): Error: _d_arraysetcapacity cannot be interpreted at compile time, because it has no available source code
called from here: reserve(i_n, 1LU << cast(int)((p + 1LU) * 1LU))

I've looked in the directory it provides and as far as I can tell 
the code does exist. I.e. in std.math:
real fmod(real x, real y) @trusted nothrow @nogc
{
     version (CRuntime_Microsoft)
     {
         return x % y;
     }
     else
         return core.stdc.math.fmodl(x, y);
}

and in core.stdc.math:
    ///
     double  fmod(double x, double y);
     ///
     float   fmodf(float x, float y);
     ///
     extern(D) real fmodl()(real x, real y) { return 
fmod(cast(double) x, cast(double) y); }

Thanks


More information about the Digitalmars-d-learn mailing list