This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ada/35886] Bad location of error message
- From: "sam at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 May 2008 23:01:17 -0000
- Subject: [Bug ada/35886] Bad location of error message
- References: <bug-35886-15321@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from sam at gcc dot gnu dot org 2008-05-12 23:01 -------
Given that this happens when currently analyzing "Id" (and not "Prev"), posting
the error message on "Prev" instead of "Id" may be an historical typo
(inversion between both parameters in the call to Error_Msg_NE).
For example, in the message
Error_Msg_NE (
"full declaration of } must be a record extension",
Prev, Id);
it seems more logical to print
"full declaration of <type name> defined at ... must be a record extension"
and have the error point to the full view rather than the opposite. And if you
look at the way the error message is expanded, you clearly see that "<type
name> defined at ..." comes together as one sole entity, namely "}", so the
grouping is "full declaration of (<type name> defined at ...) must be a record
extension" rather than "(full declaration of <type name>) defined at ... must
be a record extension". And the error location (where the error is posted)
already gives a primary location which I expect to be the problematic one.
So I'm not sure this should be classified as an enhancement request only, as
the grouping due to the expansion of "}" shows an anomaly. Anyway, a trivial
patch has been proposed already, waiting for your approval.
--
sam at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|enhancement |minor
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35886