comp.lang.ada
 help / color / mirror / Atom feed
From: Tucker Taft <stt@averstar.com>
Subject: Re: Beginner's questions
Date: 1999/05/10
Date: 1999-05-10T00:00:00+00:00	[thread overview]
Message-ID: <3737122F.88561124@averstar.com> (raw)
In-Reply-To: 7gn3ho$c0e$1@nnrp1.dejanews.com

dennison@telepath.com wrote:
> 
> In article <FB6yDx.53x.0.-s@inmet.camb.inmet.com>,
>   stt@houdini.camb.inmet.com (Tucker Taft) wrote:
> > If you use "type String_Ptr is access constant String" to
> > declare your pointer type, then the language prevents
> > erroneous overwriting of the strings, and the compiler
> > (if it follows the Ada 95 implementation advice) will
> > allocate and initialize the pointed-to strings at link-time, rather than
> > run-time, exactly like "C" string literals.
> 
> Ohhhhh, nifty! That was effectively an Ada 83 code chunk I posted. I'll have
> to remember to use "access constant" next time it comes up.
> 
> Does your last sentence only apply for package specs and bodies, not for
> subprograms? When I use this trick, its typically in my "main" subprogram.

It should work in all environments, when the initial value is
known statically.  However, this is just implementation advice,
and I can imagine that some compilers are not yet doing the
right thing.
> 
> --
> T.E.D.
-- 
-Tucker Taft   stt@averstar.com   http://www.averstar.com/~stt/
Technical Director, Distributed IT Solutions  (www.averstar.com/tools)
AverStar (formerly Intermetrics, Inc.)   Burlington, MA  USA




  reply	other threads:[~1999-05-10  0:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-05-02  0:00 Beginner's questions Marco Schmidt
1999-05-02  0:00 ` Matthew Heaney
1999-05-03  0:00   ` Marco Schmidt
1999-05-03  0:00     ` Matthew Heaney
1999-05-03  0:00 ` dennison
1999-05-04  0:00   ` Tucker Taft
1999-05-04  0:00     ` dennison
1999-05-10  0:00       ` Tucker Taft [this message]
1999-05-03  0:00 ` Andreas Winckler
1999-05-03  0:00   ` Matthew Heaney
1999-05-03  0:00     ` Andreas Winckler
1999-05-03  0:00       ` David Starner
1999-05-04  0:00         ` Andreas Winckler
1999-05-04  0:00           ` Larry Kilgallen
1999-05-04  0:00             ` Martin C. Carlisle
1999-05-04  0:00               ` Larry Kilgallen
1999-05-05  0:00                 ` Andreas Winckler
1999-05-04  0:00 ` czgrr
1999-05-04  0:00   ` Nick Roberts
1999-05-07  0:00     ` Robert Dewar
1999-05-07  0:00       ` David Starner
1999-05-08  0:00         ` ak
replies disabled

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