From: ncohen@watson.ibm.com (Norman H. Cohen)
Subject: Re: Conformance problem in VAX Ada?
Date: 12 Dec 1994 16:10:06 GMT
Date: 1994-12-12T16:10:06+00:00 [thread overview]
Message-ID: <3chsku$1abb@watnews1.watson.ibm.com> (raw)
In-Reply-To: 00988B51.1523CFA0.69@gtewd.mtv.gtegsc.com
In article <00988B51.1523CFA0.69@gtewd.mtv.gtegsc.com>, Dave Papay
M/S 7G32 x2791 <papayd@GTEWD.MTV.GTEGSC.COM> writes:
|> While writing some code, I accidentally put different default expressions for
|> a parameter in the declaration and body of a procedure. Here's what it looked
|> like, except that procedure Error did some real work ;-) :
|>
|> with Text_IO;
|> procedure Test is
|>
|> procedure Error (I : in Integer := Integer'First);
|>
|> procedure Error (I : in Integer := Integer'Last) is
|> begin
|> Text_IO.Put_Line (Integer'Image (I));
|> end Error;
|>
|> begin
|> Error;
|> end Test;
|>
|> I compiled it using VAX Ada v2.3-3 under VAX/VMS v5.5-2. The compiler didn't
|> complain
...
|> Is this a compiler problem, or am I missing something in the
|> conformace rules?
Definitely a compiler problem. Funny thing is, I tried it on a compiler
with a quite different lineage and got the same result. When I changed
the default value in the Error declaration from Integer'First to 0,
however, the compiler caught the mismatch. When I changed it to
Natural'Size, the mismatch was not caught. The compiler's strategy seems
to be, "If you've seen one attribute, you've seen them all."
--
Norman H. Cohen ncohen@watson.ibm.com
next prev parent reply other threads:[~1994-12-12 16:10 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 [this message]
1994-12-16 13:49 ` Robert Dewar
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