comp.lang.ada
 help / color / mirror / Atom feed
From: Vincent Celier <vcelier@direct.ca>
Subject: Re: Ada strangeness or bug in Gnat?
Date: 1996/11/06
Date: 1996-11-06T00:00:00+00:00	[thread overview]
Message-ID: <3281562B.2266@direct.ca> (raw)
In-Reply-To: 55prap$7q9@arktur.rz.uni-ulm.de


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




  reply	other threads:[~1996-11-06  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-11-06  0:00 Ada strangeness or bug in Gnat? Henry Ware
1996-11-05  0:00 ` Vincent Celier
1996-11-06  0:00   ` Joerg Rodemann
1996-11-06  0:00     ` Vincent Celier [this message]
1996-11-06  0:00   ` Ronald Cole
1996-11-06  0:00     ` Robert Dewar
1996-11-07  0:00   ` Peter Amey
replies disabled

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