This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Diagnostic Messaging Suggestion
- From: Tom Tromey <tromey at redhat dot com>
- To: Joe Buck <Joe dot Buck at synopsys dot COM>
- Cc: Arthur Schwarz <aschwarz1309 at verizon dot net>, Jonathan Wakely <jwakely dot gcc at gmail dot com>, "gcc\ at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Fri, 17 Apr 2009 11:58:48 -0600
- Subject: Re: Diagnostic Messaging Suggestion
- References: <371233.23667.qm@web84004.mail.mud.yahoo.com> <20090417034452.GB10330@synopsys.com>
- Reply-to: tromey at redhat dot com
>>>>> "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