comp.lang.ada
 help / color / mirror / Atom feed
From: Craig Allen <cpallen@my-deja.com>
Subject: Re: Ada version of C's 'static'
Date: 1999/07/30
Date: 1999-07-30T00:00:00+00:00	[thread overview]
Message-ID: <7nsuf3$tm9$1@nnrp1.deja.com> (raw)
In-Reply-To: 3798EDE9.90B9623B@averstar.com

In article <3798EDE9.90B9623B@averstar.com>,
  Tucker Taft <stt@averstar.com> wrote:
> Craig Allen wrote:
> >
> > I've written some code in a procedure that operates on a table of
> > constants.  The table is used only by that procedure.  Right now, I
have
> > that table defined locally to that procedure.  I believe the table
is
> > regenerated every time the procedure is called.
>
> Why do you believe it is regenerated?  It shouldn't be if the
> table is of compile-time known size with compile-time known values.
>

I was worried about this and I looked at the assembly created by the
compiler.  I believe that upon entry to the function, the table was
regenerated every time even after making sure the data was constant.
After implementing the inner package suggestion (thanks Dave) I again
looked at the assembly output and this time it looked as if the table
was not being generated upon entry.


> If the values are known at compile-time, then any Ada compiler
> worth its salt will allocate and initialize the table statically,
> no matter where it is declared.  If the compiler is not worth
> its salt, then you probably have bigger problems anyway, so I wouldn't
> worry about that contingency.  Either that, or complain to/threaten
> your compiler vendor ;-).

I couldn't run my water softener off this compiler.  Seriously, I'm
using a VAX hosted Tartan 83 Ada compiler and do not enjoy it.  Learning
Ada is not easy when you must also question the compiler (cases of
experienced people saying 'oh, we've had problems with that with the
compiler, and so we just avoid doing it.')

-Craig



Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




  reply	other threads:[~1999-07-30  0:00 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-19  0:00 Ada version of C's 'static' Craig Allen
1999-07-19  0:00 ` David Botton
1999-07-20  0:00 ` Simon Wright
1999-07-23  0:00 ` Tucker Taft
1999-07-30  0:00   ` Craig Allen [this message]
1999-08-03  0:00     ` Compilers for VAX Was: " Erdelyi Gaspar
1999-08-03  0:00       ` Larry Kilgallen
1999-08-04  0:00       ` Robert Dewar
1999-08-04  0:00         ` Rod Chapman
1999-08-04  0:00           ` Larry Kilgallen
1999-08-04  0:00             ` Robert Dewar
1999-08-04  0:00             ` Marin David Condic
1999-08-04  0:00               ` Robert Dewar
1999-08-04  0:00               ` Larry Kilgallen
1999-08-04  0:00           ` Robert Dewar
1999-08-04  0:00         ` Chris Miller
1999-08-05  0:00           ` Robert Dewar
1999-08-04  0:00       ` Steve Doiel
1999-08-05  0:00         ` Robert Dewar
1999-08-05  0:00           ` Larry Kilgallen
1999-08-06  0:00             ` Robert A Duff
1999-08-06  0:00               ` Larry Kilgallen
1999-08-09  0:00                 ` Robert A Duff
1999-08-09  0:00                   ` Richard D Riehle
1999-08-09  0:00                     ` Tucker Taft
1999-08-10  0:00                     ` Robert A Duff
1999-08-08  0:00               ` Robert Dewar
replies disabled

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