Quality of errors in DMD

Nemanja Boric via Digitalmars-d digitalmars-d at puremagic.com
Sun Sep 4 11:20:54 PDT 2016


On Sunday, 4 September 2016 at 17:56:08 UTC, David Nadlinger 
wrote:
> On Saturday, 3 September 2016 at 22:39:22 UTC, Walter Bright 
> wrote:
>> Because it's useless to anyone but the compiler devs, and it 
>> adds cruft to the compiler. And even worse than useless, it 
>> confuses the user into thinking it is a meaningful message.
>
> This is short-sighted, for the reason I pointed out in my 
> earlier post. How would you go about reporting an ICE for a 
> 100k LOC test case without any idea about where to start 
> looking?
>
> In fact, that's precisely what happened to the guys at Weka 
> before, although I'm certain they are not alone with this. They 
> encountered ICEs when updating the compiler version with no way 
> to narrow it down. Of course, *I* could just build DMD with 
> symbols and have a look at what was going on in GDB, but that's 
> the luxury of being a compiler dev.
>
>> Let's not pretend the user can debug the compiler.
>
> They can create bug reports to help other people to do so, 
> though.
>
>  — David

I second this - sometimes you find it way too late: We had a 
nasty problem few weeks ago where *only compiling with `-O`*
kept crashing a compiler on a assertion 
(https://issues.dlang.org/show_bug.cgi?id=16225). And it was 
several thousands lines worth of code spread across many modules.

What I find useful is enabling debug prints of dmd, compiling and 
first concentration on the last mentioned module (I don't 
remember if this was already there, or if I extended some 
`writeln/printf`there). Then I approached it in the usual way - 
binary removing/putting back chunks of code.


More information about the Digitalmars-d mailing list