D is dead
Shachar Shemesh
shachar at weka.io
Fri Aug 24 01:57:03 UTC 2018
On 23/08/18 23:46, Walter Bright wrote:
> In my experience with debugging code, if drilling down to find the cause
> of the problem is not done, there is no way to conclude whether whether
> it is a compiler bug or a user bug.
>
> (Of course, compiler internal errors are always compiler bugs.)
>
> Drilling down and finding it to be a compiler problem also usually
> suggests a practical workaround for it.
Consider the following line from the weka code base:
_trustedData.opIndex(diskIdx) &= NotBitmap(toDistrust);
That's strange. Why didn't Shachar just do?
_trustedData[diskIdx] &= NotBitmap(toDistrust);
Answer: Because the compiler decided that it needs to call
_trustedData.opIndexAssign, and then failed the compilation because it
has none. There is no way that that is a bug in the code. This is a
compiler bug (maybe since fixed. This is fairly old code).
So, where's the issue number, I hear you ask? There is none. This
problem only happens inside the code base. Once I tried to isolate it, I
couldn't reproduce.
At this point I can either use the work-around I already have and (try
to, obviously unsuccessfully) forget about it, file a bug report that
will be (justifiably) ignored because no-one else can reproduce it, or
spend an unknown amount of time (two days would probably be low-balling
at this point) in trying to get this to reproduce on a watered down
version of the code.
Which would you pick?
Shachar
More information about the Digitalmars-d
mailing list