Ian> For a middle-end error like
Ian> "assuming signed overflow does not occur when simplifying
Ian> multiplication" a caret pointer might be more misleading than
Ian> otherwise, as one thing we know for sure is that it would not point at
Ian> a multiplication operator.

Chris> An important class of middle-end warnings is use of undefined values
Chris> and other dataflow warnings in GCC.

Yes, this is what I was thinking about as well.

Ian> What do other compilers do?  Reopening the file doesn't work for
Ian> standard input, which I admit is an unusual case.

We have many options here of course.  We can write stdin to a file.
We could keep the buffer around in this one specific case and have a
special case in the code.  We could say "-fshow-caret is not supported
with stdin".


Perhaps I was mistaken to state an implementation preference this
early, anyway.  It would be fine by me to have an implementation that
works in any reasonable way.  If the "don't free" approach proves too
costly, with sane API design we will know we can always rip it out and
go with "reopen and seek".

Tom

Reply via email to