From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,75b74a06c7b14eed X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-12-12 08:10:06 PST Path: nntp.gmd.de!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!rutgers!sgigate.sgi.com!olivea!spool.mu.edu!howland.reston.ans.net!pipex!sunsite.doc.ic.ac.uk!aixssc.uk.ibm.com!watnews.watson.ibm.com!ncohen From: ncohen@watson.ibm.com (Norman H. Cohen) Newsgroups: comp.lang.ada Subject: Re: Conformance problem in VAX Ada? Date: 12 Dec 1994 16:10:06 GMT Organization: IBM T.J. Watson Research Center Distribution: world Message-ID: <3chsku$1abb@watnews1.watson.ibm.com> References: <00988B51.1523CFA0.69@gtewd.mtv.gtegsc.com> Reply-To: ncohen@watson.ibm.com NNTP-Posting-Host: rios8.watson.ibm.com Date: 1994-12-12T16:10:06+00:00 List-Id: In article <00988B51.1523CFA0.69@gtewd.mtv.gtegsc.com>, Dave Papay M/S 7G32 x2791 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