Character index vs Column number in GHC error messages

Simon Marlow simonmar at
Tue Sep 13 04:09:57 EDT 2005

On 12 September 2005 22:39, Krasimir Angelov wrote:

> 2005/9/12, Simon Marlow <simonmar at>:
>> GNU CPP reports the column number, not the char index, AFAICT.  Try
>> the attached file.
> CPP returns the following error for the attached file:
> ctest22.c:3:13: macro "undefined" requires 2 arguments, but only 1
>  given undefined;
> 13 is exactly the index of the closing paren. In the same time, with
> tab size 4, the 13-nth column is at the character 'd' from
> "undefined".
> I am using CPP version 3.4.4
> $ cpp --version
> cpp (GCC) 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)
> Copyright (C) 2004 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There
> is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A

Interesting - this behaviour changed around GCC 3.4 it seems.

One other small piece of evidence is that Emacs' C-x = command returns a
column number, not a char index.

Ok, given that most of the world seems to want char indices (or doesn't
care), I'm happy for GHC to report char indices.


More information about the Glasgow-haskell-users mailing list