This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Diagnostic Messaging Suggestion


>>>>> "Joe" == Joe Buck <Joe.Buck@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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]