An example of Clang error messages

Nick Sabalausky a at a.a
Fri Mar 5 13:35:19 PST 2010


"Pelle Månsson" <pelle.mansson at gmail.com> wrote in message 
news:hmrniv$vpc$1 at digitalmars.com...
> On 03/05/2010 07:26 PM, Walter Bright wrote:
>> and here's what DMD does:
>>
>> test.d(6): Error: incompatible types for ((c) + (d)): 'Foo' and 'int'
>>
>
> Adding a column number brings that to the same level of information as the 
> ^-deal, right?
>

Column number (really an offset from the start of the line, though, not an 
actualy "column") wouldn't be prone to error when the line includes a tab, 
like the ^-thing would be. Also, column number parsing is already present in 
many editors, but I've never seen one that parsed ^-stuff, and you'd 
probably have a harder time convincing editor developers to implement that 
since it's far less common among compilers.

> Could be useful like the XCode sample from earlier.
>
> However, I like the way it is now because of the lack of false information 
> (should the column number be wrong), and I ususally just jump to the line 
> number anyway.

It's possible for line numbers to be wrong too, especially when a language 
supports multi-line statements. And DMD in particular generates wrong line 
numbers when there's an error inside a string mixin.

Also, many editors, like Programmer's Notepad, can jump to the line *and* 
column, which I personally find to be very nice when I have lines that are 
non-trivial (ie, frequently enough to matter). 





More information about the Digitalmars-d mailing list