comp.lang.ada
 help / color / mirror / Atom feed
From: Peter Amey <pna@erlang.praxis.co.uk>
Subject: Re: Are there any "bad" Ada constructs?
Date: 1996/09/05
Date: 1996-09-05T00:00:00+00:00	[thread overview]
Message-ID: <Pine.SUN.3.91.960905094006.2507B-100000@erlang.praxis.co.uk> (raw)
In-Reply-To: 322E16DC.74B1@swcp.com



> 
> My question is: Are there any constructs in Ada that are permitted to do
>     two or more different things and still be correct, in a manner that
>     is similar to that listed above?
> 

There are, mostly associated with aliasing, evaluation order and 
elaboration order.  A simple example is:

procedure Init2(X, Y : out integer)
is
begin
  X := 1;
  Y := 2;
end Init2;

The call Init2(A, A); can set A to 1 or 2 because the order of parameter 
association is undefined (I have two validated compilers which actually 
demonstrate this effect).

Ada has a bit of a cop out in that it labels programs whose meaning 
varies in this way "erroneous"; however, applying such a label doesn't 
make the problems any easier to detect or prevent.  Some secure Ada 
subsets such as SPARK are completely free of this form of anomalous 
behaviour.

Peter





  parent reply	other threads:[~1996-09-05  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-09-04  0:00 Are there any "bad" Ada constructs? Gordon Dodrill
1996-09-05  0:00 ` Dennison
1996-09-05  0:00 ` Jerome Desquilbet
1996-09-05  0:00 ` Peter Amey [this message]
1996-09-16  0:00   ` George Haddad
replies disabled

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