On Saturday, 21 September 2013 at 19:47:08 UTC, Walter Bright wrote:
On 9/21/2013 12:38 PM, eles wrote:
On Saturday, 21 September 2013 at 18:55:46 UTC, Walter Bright wrote:
On 9/21/2013 11:03 AM, Maxim Fomin wrote:

test.c:4: error: overflow in enumeration values

It would be difficult to make the front-end track also the column number where
it encountered (estimated) the error?

That's gcc, and 4 is the line number (and the wrong line number) of the error. No column number.

I knew that.

This will make error messages a bit more clear (and in the line of thos in gcc), especially for long code lines (where you could have, for example, several
instructions on the line).

At the beginning, until the feature is really implemented, the front-end could
always provide "column=1", ie stick with current approach.

But this will help the gdc/ldc-implementations to be in line with the messages
provided by gcc and clang.

Tracking the column number is certainly doable, but it comes at a cost of memory consumption and some compile speed, since it has to be tracked in every token. I used to do it in the Digital Mars C compiler, but it was of only marginal utility and I dropped it.

See this thread, pls:

http://forum.dlang.org/thread/vtpcxubtuquvelsof...@forum.dlang.org

Also, this link ("C family") for colors and caret:

http://gcc.gnu.org/gcc-4.9/changes.html

clang implemented this and pressure was put on gcc to do the same.

Good and clear diagnostic messages/display are of big help, I think.

Reply via email to