An example of Clang error messages

Marianne Gagnon auria.mg at gmail.com
Fri Mar 5 08:29:10 PST 2010


Walter Bright Wrote:

> Jacob Carlborg wrote:
> > Why would you remove such a useful feature if it's already implemented? 
> > I think too often people just complain when they don't like something 
> > and when they do like something they just sit silently. Perhaps they use 
> > IDEs when compiling that take them directly to the file and line number 
> > when they get a compiler error.
> 
> It really didn't add much of any useful value, likely because one line 
> of source code all by itself just doesn't give enough context. And yes, 
> people do use IDEs or editors that parse the error message and put the 
> cursor on the correct line, which is far more useful.
> 
> One annoying problem with it is each error consumes 3 lines instead of 
> one, and stuff you wanted to see got scrolled off the top of the window.
> 
> It's still in the DMC C and C++ compiler, try it out. I just didn't 
> implement it for the D compiler.

I am not familiar with the error messages given by DMC; in my own experience, I found that feature useful when e.g. you have something like

x = (a + b) * (c + d) / (e + f);

and you have error message "invalid operands to +" or so. Then

x = (a + b) * (c + d) / (e + f);
                        ^

helps. Of course, a better error message saying "variable 'c' of type 'Foo' cannot be used as operand to +" works too



More information about the Digitalmars-d mailing list