comp.lang.ada
 help / color / mirror / Atom feed
From: Eric Miller <ewmiller@tiac.net>
Subject: Re: Ada 83 - avoiding unchecked conversions.
Date: 1996/12/17
Date: 1996-12-17T00:00:00+00:00	[thread overview]
Message-ID: <32B6905F.FC4@tiac.net> (raw)
In-Reply-To: 58np72$9qp@news.nyu.edu


Richard Kenner wrote:
> 
> In article <32b03008.564464@netnews.worldnet.att.net> dewi@cableol.co.uk (Dewi Daniels) writes:
> >Ada 83 prohibits the use of address clauses to alias two variables
> >(LRM 13.5). I believe it's legal in Ada 95. My preference would be to
> >use an unchecked conversion.
> 
> An unchecked conversion is much more efficient.  Using an address
> clause not only forces the object into memory, but disables many
> optimizations on it (essentially treats it as volatile).

I'm fairly certain that we're heading into compiler-specific territory
now.  Efficiency issues are tough to generalize.

I used to work at the same company as a guy who was having problems with
a program that ran (essentially in batch) for several hours.  One of his
optimizations was to switch all the unchecked conversions to conversions
using overlays.  Apparently on that compiler (VAX Ada 1.something)
unchecked conversion was doing some checks.

My recommendation is to use unchecked conversion because you're doing
just what your code says you're doing.  Overlays just give the reader
one more thing to think about.

Eric




  reply	other threads:[~1996-12-17  0:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <md5:8B831999BCF200C6E70994BDF6CC529F>
1996-12-11  0:00 ` Ada 83 - avoiding unchecked conversions Chris Sparks (Mr. Ada)
1996-12-11  0:00   ` Dewi Daniels
1996-12-12  0:00     ` Richard Kenner
1996-12-17  0:00       ` Eric Miller [this message]
1996-12-18  0:00         ` Robert Dewar
1996-12-18  0:00           ` Robert A Duff
1996-12-19  0:00           ` Keith Thompson
1996-12-26  0:00             ` Robert Dewar
1996-12-11  0:00   ` Matthew Heaney
1996-12-12  0:00     ` Chris Brand
1996-12-13  0:00       ` Stephen Leake
1996-12-14  0:00         ` Robert A Duff
1996-12-14  0:00     ` BGaffney42
1996-12-19  0:00   ` Robert I. Eachus
1996-11-27  0:00 Ensco Vendor
1996-11-27  0:00 ` Robert I. Eachus
1996-11-29  0:00 ` Robert Dewar
1996-12-01  0:00   ` Darel Cullen
1996-11-30  0:00     ` Robert Dewar
1996-12-11  0:00     ` Richard Riehle
1996-12-02  0:00 ` Ted Dennison
1996-12-10  0:00   ` Matthew Heaney
replies disabled

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