comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@cs.nyu.edu (Robert Dewar)
Subject: Re: Conformance problem in VAX Ada?
Date: 16 Dec 1994 08:49:00 -0500
Date: 1994-12-16T08:49:00-05:00	[thread overview]
Message-ID: <3cs5sc$mar@gnat.cs.nyu.edu> (raw)
In-Reply-To: 3chsku$1abb@watnews1.watson.ibm.com

I certainly agree that this is a compiler problem (failure to diagnose
different default expressions as conformance problem). Here is the GNAT
output:

     1. with Text_IO;
     2. procedure Test is
     3.
     4.    procedure Error (I  : in Integer := Integer'First);
     5.
     6.    procedure Error (I  : in Integer := Integer'Last) is
                     |
        >>> not fully conformant with declaration at line 4
        >>> default expression for "I" does not match

     7.    begin
     8.       Text_IO.Put_Line (Integer'Image (I));
     9.    end Error;
    10.
    11. begin
    12.    Error;
    13. end Test;

THe checking of default expressions is tricky, because they don't have
to be identical (for instance X.A can match A, and things get worse in
9X where "+(a,b) can match a+b. On the other hand 3 does not match 1+2,
so if your compiler folds 1+2 to 3 (which you can expect given that 1+2
is static), it had better make sure this does not happen at a point that
will result in false conformance.

Still this particular case seems pretty straightforward, and would suggest
that the compiler(s) involved are taking some shortcuts on conformance
analysis.




  reply	other threads:[~1994-12-16 13:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-12-10  8:54 Conformance problem in VAX Ada? Dave Papay M/S 7G32 x2791
1994-12-12 16:10 ` Norman H. Cohen
1994-12-16 13:49   ` Robert Dewar [this message]
1994-12-13  9:05 ` Andreas Schulz RIT14
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox