An example of Clang error messages

Nick Sabalausky a at a.a
Fri Mar 5 09:54:03 PST 2010


"Marianne Gagnon" <auria.mg at gmail.com> wrote in message 
news:hmrbgm$8be$1 at digitalmars.com...
> 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

Many compilers handle that by providing both a line number and a "column" 
number (not actually a true column number, as tabs get counted as 1, but 
that's as it should be since tabsize is an editor setting anyway.) 





More information about the Digitalmars-d mailing list