Bug 2092 – Stuff that doesn't compile in Phobos

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2008-05-10T13:19:00Z
Last change time
2014-02-24T16:00:20Z
Assigned to
clugdbug
Creator
ary

Comments

Comment #0 by ary — 2008-05-10T13:19:50Z
Here's a listing of things that doesn't compile in Phobos. I'm using Phobos to see if Descent semantic was ported correctly from DMD, and from a long time now I've found errors in Phobos which Descent reports correctly. Maybe you didn't notice them as errors because some of them are inside unittest blocks, others are inside static ifs which may not hold. etc.gamma.d ------------ Line 286: assert(feqrel(tgamma(i * 1.0L), fact) > real.mant_dig - 15); template std.math.feqrel(X) cannot deduce template function from argument types (real,double) Lines 420-421: assert(std.math.isPosZero(lgamma(1.0L))); assert(std.math.isPosZero(lgamma(2.0L))); std.math.isPosZero doesn't exist. std.math.d ------------ Function real frexp(real value, out int exp): Inside "static if (real.mant_dig==53)" a variable named "ve" is used, by it isn't declared anywhere. Possible solutions are "vu" or "vl", I don't know which one is the correct one. Function int issubnormal(real x): Inside "static if (real.mant_dig == 53)" a function named "isSubnormal" is invoked, but it isn't declared anywhere. Same with the last else. Probably it should be "issubnormal". Lines 904: vu[F.EXPPOS_SHORT] = (0x8000 & vu[F.EXPPOS_SHORT]) | 0x3FE0; 912: sgn = (0x8000 & vu[F.EXPPOS_SHORT])| 0x3FE0; give warnings about implicit conversion. Wrapping everything in cast(ushort) solves the problem. (if warnings are enabled, some template instances fail)
Comment #1 by clugdbug — 2008-05-28T02:09:48Z
Fixed in Phobos SVN commit 735.
Comment #2 by clugdbug — 2008-06-19T13:52:34Z
This should all be fixed in 2.015 and 1.031. Please confirm.
Comment #3 by ary — 2008-06-19T19:43:51Z
I've just verified this, the warnings are gone. Umm... I just found two other errors, I must have deleted them before when reporting the previous ones, sorry. :-( Should I create another ticket for them? Anyway, I'll report them here. std.stream ---------- Line 2419: em.fixBO(x3,12); I get "std/stream.d: function fixBO (void*,uint) does not match parameter types (ubyte[12],int)" (and another error following that) Same goes for line 2443. I'm not sure about this, but casting the first argument (x3) to void* solved the problem. Maybe a static ubyte[] was allowed to be implicitly cast to void* in a previous D version...
Comment #4 by clugdbug — 2008-06-23T10:42:32Z
The new bugs should go into a different ticket, since the original bugs are fixed. Then close this one. I think it should be .ptr, not a cast to void *, eg em.fixBO(x3.ptr,12);