I just found dustmite...

ed growlercab at gmail.com
Fri Jan 31 19:05:28 PST 2014


I've only now got the chance to try 2.065 beta and I have to say 
it's very good. All code breakages I've encountered so far are 
valid; real bugs missed in 2.064.

I was compiling msgpack with dmd2065 and it failed in unittests:
(https://github.com/msgpack/msgpack-d/tree/master/src)

msgpack.d(1099): Error: declaration 
msgpack.msgpack.__unittestL1044_2.tests is already defined in 
another scope in __unittestL1044_2
msgpack.d(1139): Error: declaration 
msgpack.msgpack.__unittestL1044_2.tests is already defined in 
another scope in __unittestL1044_2
msgpack.d(1247): Error: declaration 
msgpack.msgpack.__unittestL1044_2.tests is already defined in 
another scope in __unittestL1044_2

At first I thought regression, then I realised what the error was 
and knew I'd seen this problem caught building apps with 2.064. 
So I thought I give dustmite a go to reduce the code down to 
something managable...it produced this lovely little snippet:

unittest
{
{ // uint *
static UTest[]tests ;

}
static STest[]tests ;

}

 From this it was trivial to investigate using each DMD version 
and variants of the code, placing the bug in a function not a 
unittest etc.

It turns out 2.064 didn't pick up the error at all, the linker 
did.

Cheers,
ed


More information about the Digitalmars-d mailing list