comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: Overlay allowability
Date: 2000/05/08
Date: 2000-05-08T00:00:00+00:00	[thread overview]
Message-ID: <8f744h$s38$1@nnrp1.deja.com> (raw)
In-Reply-To: 3916D7F4.178B4FDE@Raytheon.com

In article <3916D7F4.178B4FDE@Raytheon.com>,
  "Samuel T. Harris" <samuel_t_harris@Raytheon.com> wrote:

> The poster wasn't asking about UCing the pointers.
> The question was about UCing the data vs making an overlay.
> UCing pointers an another way to make overlays which are
> IMO less clear to the reader than a address clause.

Well you can have any opinion you like. But unchecked conversion
is far better defined than overlay. The latter is completely
implementation defined, and may cause havoc due to descriptors
etc.

> Conversion of access types only works when the access types
> are in the same storage pool.

Good practice here is to use unchecked conversion only on
general access pointers which do NOT reference unconstrained
array types.

> Just what is dubious about this advice.
> You are simpy defining two additional way to define an overlay
> yet you make no comment on the deciding factor!

The deciding factor is that unchecked conversion is far better
defined, better signalled in the sources (i.e. the use of
potentially unsafe techniques is better flagged to the reader),
and is far more likely to be portable than the use of address
overlays.


> I can't see why this is preferable over a straight address
> clause of objects of a and b. Besides, when the needs comes,
> often times one or the other object is already declared.
> Therefore AV or BV, as appropriate, will have to be setup
> to point to the already declared object. Seems like a lot
> of extra stuff when one address clause is needed.

The extra stuff, and most particularly the "with

Unchecked_Conversion" in the context clause is welcome
to raise red flags. This is NOT the kind of thing we want
writers to do conveniently and inconspicuously.

> Also, a lot of extra stuff when a single address clause
> is called for. I don't see the advantage of these indirect
> views. Also, is a_Access and/or b_Access are allocated
> to user defined storage pools, then isn't this going to
> create problems?

You should use general access types, as indicated in my
examples.

> > I think I preferred the Ada 83 formulation.
>
> Do you mean "for b use at x'address;" ?

No, I mean the rule in Ada 83 that said that use of address
clauses to achieve overlays was always erroneous. The syntax
is neither here nor there.


Sent via Deja.com http://www.deja.com/
Before you buy.




  reply	other threads:[~2000-05-08  0:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-01  0:00 Overlay allowability Marc A. Criley
2000-05-01  0:00 ` Ted Dennison
2000-05-03  0:00   ` Samuel T. Harris
2000-05-03  0:00     ` Robert A Duff
2000-05-03  0:00     ` Ted Dennison
2000-05-04  0:00     ` Robert Dewar
2000-05-08  0:00       ` Samuel T. Harris
2000-05-08  0:00         ` Robert Dewar [this message]
2000-05-09  0:00           ` Samuel T. Harris
2000-05-09  0:00             ` Ted Dennison
2000-05-10  0:00               ` Marc A. Criley
2000-05-11  0:00                 ` tmoran
2000-05-12  0:00                   ` tmoran
2000-05-01  0:00 ` Tucker Taft
2000-05-01  0:00   ` Keith Thompson
2000-05-08  0:00     ` Tucker Taft
2000-05-01  0:00   ` mark_biggar
2000-05-03  0:00   ` Robert I. Eachus
2000-05-01  0:00 ` tmoran
2000-05-02  0:00 ` Robert I. Eachus
2000-05-03  0:00   ` Marc A. Criley
replies disabled

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