>>>>> "Aldy" == Aldy Hernandez <al...@redhat.com> writes:

Aldy> enum e {
Aldy>   E5 = INTMAX + 1,
Aldy>               ^ column 15.
Aldy> };

I updated from your branch and tried this.  My error message had
column 3... but I assume that is due to something missing or due to
over-eager folding (and thus probably fixed, or fixable, using
Joseph's branch).

I tried a variant without folding:

    void *x;
    void *y;

    #define ZARDOZ x

    void *z = ZARDOZ + y;

Here I get:

opsy. gcc -fshow-column --syntax-only q.c
q.c:7:18: error: invalid operands to binary + [...]

... which is correct.

Aldy> Pre-processed code is common enough that it would be annoying to have
Aldy> GCC consistently print out incorrect column numbers for code containing
Aldy> it.

I think this ought to be working already.  One way to verify is to
debug cc1 and look at the locations on the tokens returned by libcpp.
If they are correct then the problem lies somewhere in the front end.

Offhand the only weird thing libcpp does right now is that it will
return the same location for all tokens resulting from a macro
expansion.  I'd like to fix this to do something nicer, but I have not
found the time.

Tom

Reply via email to