public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/35886]  New: Bad location of error message
@ 2008-04-09 13:18 sam at gcc dot gnu dot org
  2008-04-09 13:28 ` [Bug ada/35886] " sam at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: sam at gcc dot gnu dot org @ 2008-04-09 13:18 UTC (permalink / raw)
  To: gcc-bugs

GNAT switches the location of the full type and the incomplete type when a
tagged type is completed with a non-tagged record:

% gcc -gnatv -c p.ads
GNAT 4.4.0 20080409 (experimental)
Copyright 1992-2008, Free Software Foundation, Inc.

Compiling: p.ads (source file time stamp: 2008-04-09 13:15:07)

     3.    type T is tagged;
                |
        >>> full declaration of type "T" defined at line 4 must be tagged

 6 lines: 1 error

-- 
package P is

   type T is tagged;
   type T is null record;

end P;


-- 
           Summary: Bad location of error message
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: ada
        AssignedTo: sam at gcc dot gnu dot org
        ReportedBy: sam at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35886


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ada/35886] Bad location of error message
  2008-04-09 13:18 [Bug ada/35886] New: Bad location of error message sam at gcc dot gnu dot org
@ 2008-04-09 13:28 ` sam at gcc dot gnu dot org
  2008-05-12 22:35 ` charlet at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: sam at gcc dot gnu dot org @ 2008-04-09 13:28 UTC (permalink / raw)
  To: gcc-bugs



-- 

sam at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-04-09 13:27:49
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35886


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ada/35886] Bad location of error message
  2008-04-09 13:18 [Bug ada/35886] New: Bad location of error message sam at gcc dot gnu dot org
  2008-04-09 13:28 ` [Bug ada/35886] " sam at gcc dot gnu dot org
@ 2008-05-12 22:35 ` charlet at gcc dot gnu dot org
  2008-05-12 22:44 ` sam at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: charlet at gcc dot gnu dot org @ 2008-05-12 22:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from charlet at gcc dot gnu dot org  2008-05-12 22:34 -------
Well, I must be blind, but I do not see a bad location here: GNAT complains
at line 3 that the full declaration "defined at line 4" must be tagged,
showing indeed the line where type T is declared as tagged.

Looks correct to me.

Arno


-- 

charlet at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35886


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ada/35886] Bad location of error message
  2008-04-09 13:18 [Bug ada/35886] New: Bad location of error message sam at gcc dot gnu dot org
  2008-04-09 13:28 ` [Bug ada/35886] " sam at gcc dot gnu dot org
  2008-05-12 22:35 ` charlet at gcc dot gnu dot org
@ 2008-05-12 22:44 ` sam at gcc dot gnu dot org
  2008-05-12 22:55 ` charlet at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: sam at gcc dot gnu dot org @ 2008-05-12 22:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from sam at gcc dot gnu dot org  2008-05-12 22:43 -------
I expect the error message to point at the full declaration itself, not the
partial view, as the partial view had been analyzed correctly and had no error
so far. When it says "full declaration of type T declared at XXX", I expect
"XXX" to designate the partial view, not the other way around.

To take a similar situation, consider:

package T is
   X : constant Integer;
private
   X : constant Float := 3.0;
end T;

GNAT gives the error:

     4.    X : constant Float := 3.0;
           |
        >>> type does not match declaration at line 2

and not:

     2.    X : constant Integer;
           |
        >>> type doesn't match declaration at line 4

I think this is an anomaly, as this doesn't match the behaviour of GNAT in
other similar cases (a completion of a declaration not fullfilling the initial
promise).


-- 

sam at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35886


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ada/35886] Bad location of error message
  2008-04-09 13:18 [Bug ada/35886] New: Bad location of error message sam at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-05-12 22:44 ` sam at gcc dot gnu dot org
@ 2008-05-12 22:55 ` charlet at gcc dot gnu dot org
  2008-05-12 23:02 ` sam at gcc dot gnu dot org
  2009-10-03 12:55 ` sam at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: charlet at gcc dot gnu dot org @ 2008-05-12 22:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from charlet at gcc dot gnu dot org  2008-05-12 22:54 -------
OK, classifying as an enhancement request, since there's no bug here, the error
message is correct.


-- 

charlet at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|minor                       |enhancement


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35886


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ada/35886] Bad location of error message
  2008-04-09 13:18 [Bug ada/35886] New: Bad location of error message sam at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2008-05-12 22:55 ` charlet at gcc dot gnu dot org
@ 2008-05-12 23:02 ` sam at gcc dot gnu dot org
  2009-10-03 12:55 ` sam at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: sam at gcc dot gnu dot org @ 2008-05-12 23:02 UTC (permalink / raw)
  To: gcc-bugs



------- 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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ada/35886] Bad location of error message
  2008-04-09 13:18 [Bug ada/35886] New: Bad location of error message sam at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2008-05-12 23:02 ` sam at gcc dot gnu dot org
@ 2009-10-03 12:55 ` sam at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: sam at gcc dot gnu dot org @ 2009-10-03 12:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from sam at gcc dot gnu dot org  2009-10-03 12:55 -------
This has been fixed alreayd in SVN.


-- 

sam at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35886


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-10-03 12:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-09 13:18 [Bug ada/35886] New: Bad location of error message sam at gcc dot gnu dot org
2008-04-09 13:28 ` [Bug ada/35886] " sam at gcc dot gnu dot org
2008-05-12 22:35 ` charlet at gcc dot gnu dot org
2008-05-12 22:44 ` sam at gcc dot gnu dot org
2008-05-12 22:55 ` charlet at gcc dot gnu dot org
2008-05-12 23:02 ` sam at gcc dot gnu dot org
2009-10-03 12:55 ` sam at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).