From: lee@leo (Bill Lee)
Subject: Re: Updating IN OUT's after exceptions
Date: 3 May 91 12:51:43 GMT [thread overview]
Message-ID: <1991May3.125143.3704@shell.shell.com> (raw)
In-Reply-To: 20600103@inmet
In article <20600103@inmet> stt@inmet.inmet.com writes:
>
>Re: Updating IN OUT's after exceptions
> Query on 5:18 am Apr 30, 1991 by stuartw@tove.cs.umd.edu
>
>> In the enclosed program, I raise an exception inside a subroutine after
>> making an assignment to an IN OUT parameter. In the first case, the
>> parameter is a scalar, in the second it is not. Everything else is the
>> same, except the resulting behavior. Is this permitted by the LRM?
>> I know that compilers can pass non-scalar parameters by copy-in/copy-out
>> or reference, but should that effect exception handling? Is Ada/9x
>> addressing this?
>>
>> Thanks.
>>
>> Stuart. (weinstei@kong.gsfc.nasa.gov)
>
>The Good Old Reference Manual, section 6.2:12 says the following:
> If the execution of a subprogram is abandoned as a result of an exception,
> the final value of an actual parameter [...] can be either its
> value before the call [if passed by copy] or a value assigned
> to the formal parameter during the execution of the subprogram
> [if passed by reference].
>
>In other words, the compiler "does the right thing."
>
>S. Tucker Taft
>Intermetrics, Inc.
>Cambridge, MA 02138
The "Right Thing"??? Yes,.....but.....
THERE ARE NO GUARANTEES THAT ANY TWO COMPILERS WILL DO IT THE SAME!
Any program that depends on a particular implementation of the values
returned (or not returned) in a record or array under the conditions
specified is technically erroneous. Sure, it will work on the first
compiler/platform, but there is no way to believe that it will work
elsewhere.
Bill Lee lee@shell.com
Shell Oil Co.
prev parent reply other threads:[~1991-05-03 12:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1991-04-30 9:18 Updating IN OUT's after exceptions Stuart M. Weinstein
1991-05-01 22:56 ` stt
1991-05-02 17:10 ` Doug Smith
1991-05-03 12:51 ` Bill Lee [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox