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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f894972725d7613 X-Google-Attributes: gid103376,public From: Vincent Celier Subject: Re: Ada strangeness or bug in Gnat? Date: 1996/11/06 Message-ID: <3281562B.2266@direct.ca>#1/1 X-Deja-AN: 195025567 references: <328028AE.757F@direct.ca> <55prap$7q9@arktur.rz.uni-ulm.de> content-type: text/plain; charset=us-ascii organization: Canada Internet Direct, Inc. mime-version: 1.0 reply-to: vcelier@direct.ca newsgroups: comp.lang.ada x-mailer: Mozilla 3.01b1Gold (WinNT; I) Date: 1996-11-06T00:00:00+00:00 List-Id: Joerg Rodemann wrote: > > Vincent Celier (vcelier@direct.ca) wrote: > > The result you are getting is correct (from the point of view of the > > compiler). > > Your program is incorrect, because you have a case of a "Bounded Error". > > Sure? Soory, but i haven't got my RM at hand right now. But i tried this > sample program with GNAT-3.05 on HPUX 10.10. It says: 1,2. That means the > array elements were swapped --- correctly? It is not because it works with GNAT-3.05 on HPUX 10.10 that the program is not at fault: it is still a bounded error. RM95 6.2 (12) says that: "The possible consequences are that Program_Error is raised, or the newly assigned value is read, or some old value of the object is read." Henry Ware met the second case (newly assigned value) while you met the third case (old value). It does not change the fact that it is a bounded error, thus this program is not portable. > To my understanding the words "in", "out" and "in out" do not seem to make > sense any more for array parameters if your explanation ist correct. > So could someone increase my knowledge? If a parameter is passed by copy, then it is read before executing the subprogram (for "in" and "in out") and/or updated after executing the subprogram (for "out" and "in out") (RM95 6.2 (2)). If a parameter is passed by reference, "reads and updates of the formal parameter directly reference the actual parameter." (RM95 6.2(1)) > Quite curious > > George > > -- > Joerg 'George' Rodemann Erhard-Groezinger-Strasse 82 > Department of Physics D-89134 Blaustein > University of Ulm Tel. (0731) 553319 > e-mail: rodemann@mathematik.uni-ulm.de -- Vincent Celier, -- 9100 McCutcheon Place, RICHMOND, B.C. -- CANADA, V7A 5A5 -- +1 (604) 241-9811