This is the mail archive of the
mailing list for the GCC project.
Re: [RFC] GCC caret diagnostics
Tom Tromey <firstname.lastname@example.org> writes:
> Ian suggested that we delete this information after the FE is
> finished. This makes sense, I think, from a memory-saving
> perspective. But, that means we will get different kinds of error
> output depending on when a diagnostic is emitted, which I think is
> pretty unfriendly -- it exposes implementation details of gcc to the
I think that is mostly OK in practice because most diagnostics are
issued by the front end. But I admit that some come from the
middle-end, so there would be an inconsistency.
Another approach would be to only use the carets for parse errors,
which is where they are the most helpful. For a middle-end error like
"assuming signed overflow does not occur when simplifying
multiplication" a caret pointer might be more misleading than
otherwise, as one thing we know for sure is that it would not point at
a multiplication operator.
What do other compilers do? Reopening the file doesn't work for
standard input, which I admit is an unusual case.