>>>>> "Joe" == Joe Buck <joe.b...@synopsys.com> writes:

Joe> If, for definitions, the compiler keeps track of this detail, it
Joe> would be possible to reliably print
Joe> foo.h:11 error: redefinition of `a' (file was included more than once)
Joe> if the printable line number is the same but the internal line number
Joe> is different.

You could certainly implement that in today's GCC.

The "internal line number" comparison can be done by directly
comparing source_locations.

Then "printable line number" comparison can be done by expanding the
locations and comparing the contents.

Chris> Clang just prints the include stack information when anything
Chris> in the include stack differs between two consecutive
Chris> diagnostics.

We could easily do that too.

Tom

Reply via email to