comp.lang.ada
 help / color / mirror / Atom feed
* ??? Help!: how to do unconstraned arrays/records???
@ 1998-11-04  0:00 al johnston
  1998-11-04  0:00 ` Albert S. Johnston
  1998-11-05  0:00 ` Tucker Taft
  0 siblings, 2 replies; 16+ messages in thread
From: al johnston @ 1998-11-04  0:00 UTC (permalink / raw)


HELP!!!!

I a trying to convert the following "static" ada data
structure to a structure that can be created dynamically,
ie via the "new" ada function, and setting the two
constrants at that time.

I can not seem to find anything that will work (as
far as type declarations) short of
moving the second level array (Host_array) into
the top level structure (system_config_type) and
making it 2d.  That is TOO ugly!!!!

Can one of you ada guru's help me out?
the current type definitions (ie the "static"
version) are below....

thanks!!!!

      -al
-------------------------------------------------------------

NUMBER_OF_HOST_WIDGETS : Integer := some bound;
NUMBER_OF_NODE_WIDGETS : Integer := some other bound;


 type Host_Config_Typ is
    record
      ID        : Integer;
      Label     : String;
    end record;

  type Host_Array is array (natural range <>) of Host_Config_Typ;

  type Node_Config_Typ is
    record
      ID              : integer;
      Label           : String;
      Number_of_hosts : Natural := 0;
      Hosts           : Host_Array(1..NUMBER_OF_HOSTS_WIDGETS);
    end record;

  type Node_Array is array (natural rangee <>) of Node_Config_Typ;

  type System_Config_Typ is
    record
      Number_of_nodes :  Natural := 0;
      Nodes : Node_Array(NUMBER_OF_NODE_WIDGETS);
    end record;

  Config                : System_Config_Typ;






^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: ??? Help!: how to do unconstraned arrays/records???
  1998-11-04  0:00 ??? Help!: how to do unconstraned arrays/records??? al johnston
@ 1998-11-04  0:00 ` Albert S. Johnston
  1998-11-05  0:00   ` dewarr
  1998-11-05  0:00 ` Tucker Taft
  1 sibling, 1 reply; 16+ messages in thread
From: Albert S. Johnston @ 1998-11-04  0:00 UTC (permalink / raw)


woops, I forgot... I am using ada 83

Somebody help PLEASE!







^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: ??? Help!: how to do unconstraned arrays/records???
  1998-11-05  0:00     ` al johnston
@ 1998-11-05  0:00       ` dewar
  1998-11-05  0:00       ` Stephen Leake
  1 sibling, 0 replies; 16+ messages in thread
From: dewar @ 1998-11-05  0:00 UTC (permalink / raw)


In article <3641C18F.B70E8B7C@avionics2.robins.af.mil>,
  al johnston <johnstona@avionics2.robins.af.mil> wrote:

 > Why are you using an obsolete language at this stage. I can understand the
> > cases of large scale legacy projects that committed some time ago to the
> > technology, but it is hard to believe that this is your case.
>
> we have 500k of 83 code for an embedded system.  we build on a solaris
> box, and the target is a force 2ce (sparc2) cpu card using vxWorks.
>
> I have been unable to find a ada compiler vendor interested in supporting
> this configuration.  We are using VadsWorks which is now owned
> by rational.... and surprizingly they were not intrested in providing
> a version of there ada compiler (apex i think) even though they
> already have a "native" compiler for the sparc....  really pissed me of
> since they are the ones who killed vadsworks.
>
> gnat sounded promisig, but I would have to port the ada runtime
> for vxworks myself...  The real kicker was the screwy way
> gnat does makes and handles file names and preprocessor directives.
> well, its screwie relitive to the vads handles them.  it looks like it
> would tak 6-8 man months to get ported to gnat, most of that spent
> reformating files and creating make files....right now
> the time is not there...


First, you should definitely contact sales@gnat.com regarding possible
support for this configuration. GNATWorks, the VxWorks version of GNAT (*)
Professional supports a number of targets and it is most certainly practical
to port it to the SPARC card that you mention. Whether it is practical for
you to do the port on your own is of course another matter.

As for file names and preprocessing, I think you will find that it is much
easier than you think. Certainly there is no need to change file names, and
we have a number of customers who have ported very large systems (millions
of lines of code, including preprocessed code) from VADS to GNAT very rapidly,
e.g. within a few weeks, with our help.

Robert Dewar
Ada Core Technologies

(*) A version of GNATWorks has recently sucessfully completed validation
testing with version 2.1 of the ACVC suite. This is the first 100% validation
of a VxWorks Ada 95 combination, including all the annexes, and most notably,
passing 100% of the real time annex tests.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: ??? Help!: how to do unconstraned arrays/records???
  1998-11-04  0:00 ??? Help!: how to do unconstraned arrays/records??? al johnston
  1998-11-04  0:00 ` Albert S. Johnston
@ 1998-11-05  0:00 ` Tucker Taft
  1998-11-05  0:00   ` Tucker Taft
  1998-11-05  0:00   ` Tucker Taft
  1 sibling, 2 replies; 16+ messages in thread
From: Tucker Taft @ 1998-11-05  0:00 UTC (permalink / raw)


al johnston (johnstona@avionics2.robins.af.mil) wrote:

: HELP!!!!

: I a trying to convert the following "static" ada data
: structure to a structure that can be created dynamically,
: ie via the "new" ada function, and setting the two
: constrants at that time.

: I can not seem to find anything that will work (as
: far as type declarations) short of
: moving the second level array (Host_array) into
: the top level structure (system_config_type) and
: making it 2d.  That is TOO ugly!!!!

: Can one of you ada guru's help me out?
: the current type definitions (ie the "static"
: version) are below....

: thanks!!!!

:       -al
: -------------------------------------------------------------

: NUMBER_OF_HOST_WIDGETS : Integer := some bound;
: NUMBER_OF_NODE_WIDGETS : Integer := some other bound;


:  type Host_Config_Typ is
:     record
:       ID        : Integer;
:       Label     : String;
:     end record;

:   type Host_Array is array (natural range <>) of Host_Config_Typ;

:   type Node_Config_Typ is
:     record
:       ID              : integer;
:       Label           : String;
:       Number_of_hosts : Natural := 0;
:       Hosts           : Host_Array(1..NUMBER_OF_HOSTS_WIDGETS);
:     end record;

:   type Node_Array is array (natural rangee <>) of Node_Config_Typ;

:   type System_Config_Typ is
:     record
:       Number_of_nodes :  Natural := 0;
:       Nodes : Node_Array(NUMBER_OF_NODE_WIDGETS);
:     end record;

:   Config                : System_Config_Typ;

How about:

 type Host_Config_Typ is
    record
      ID        : Integer;
      Label     : String;
    end record;

  type Host_Array is array (Positive range <>) of Host_Config_Typ;
  type Host_Array_Ptr is access Host_Array;

  type Node_Config_Typ(Number_Of_Hosts_Widgets : Natural := 0) is
    record
      ID              : integer;
      Label           : String;
      Number_of_hosts : Natural := 0;
      Hosts           : Host_Array_Ptr := 
        new Host_Array(1..Number_Of_Hosts_Widgets);
    end record;

  type Node_Array is array (Positive range <>) of Node_Config_Typ;

  type System_Config_Typ(Number_Of_Node_Widgets : Natural; 
	Number_Of_Hosts_Widgets : Natural) is
    record
      Number_of_nodes :  Natural := 0;
      Nodes : Node_Array(1..Number_Of_Node_Widgets) := 
	(others => Node_Config_Typ(Number_Of_Hosts_Widgets));
    end record;

  type System_Config_Typ_Ptr is access System_Config_Typ;

Now you can create a heap-resident structure as follows:

    X : System_Config_Typ_Ptr := new System_Config_Typ(Num_Nodes, Num_Hosts);


Admittedly, there is an extra level of indirection to get to
each Host_Array, but that's the canonical solution to any 
software engineering problem!

--
-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Burlington, MA  USA
An AverStar Company




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: ??? Help!: how to do unconstraned arrays/records???
  1998-11-04  0:00 ` Albert S. Johnston
@ 1998-11-05  0:00   ` dewarr
  1998-11-05  0:00     ` al johnston
  0 siblings, 1 reply; 16+ messages in thread
From: dewarr @ 1998-11-05  0:00 UTC (permalink / raw)


In article <36410B43.E0D799BC@hom.net>,
  "Albert S. Johnston" <johnston@hom.net> wrote:
> woops, I forgot... I am using ada 83
>
> Somebody help PLEASE!


Why are you using an obsolete language at this stage. I can understand the
cases of large scale legacy projects that committed some time ago to the
technology, but it is hard to believe that this is your case.

Given a situation in which inexpensive and freely available Ada 95 compilers
are available, it seems a waste of time to use Ada 83 at this stage.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: ??? Help!: how to do unconstraned arrays/records???
  1998-11-05  0:00 ` Tucker Taft
  1998-11-05  0:00   ` Tucker Taft
@ 1998-11-05  0:00   ` Tucker Taft
  1998-11-05  0:00     ` Mats Weber
  1 sibling, 1 reply; 16+ messages in thread
From: Tucker Taft @ 1998-11-05  0:00 UTC (permalink / raw)


Tucker Taft (stt@houdini.camb.inmet.com) wrote:

: al johnston (johnstona@avionics2.robins.af.mil) wrote:

: : HELP!!!!

: : I a trying to convert the following "static" ada data
: : structure to a structure that can be created dynamically,
: : ie via the "new" ada function, and setting the two
: : constrants at that time.

: How about:
: ...

My initial solution was more complicated than it needed to be.

Simpler is to introduce the level of indirection directly in the 
Node_Array, as follows:

 type Host_Config_Typ is
    record
      ID        : Integer;
      Label     : String;
    end record;

  type Host_Array is array (Positive range <>) of Host_Config_Typ;

  type Node_Config_Typ(Number_Of_Hosts_Widgets : Natural) is
    record
      ID              : integer;
      Label           : String;
      Number_of_hosts : Natural := 0;
      Hosts           : Host_Array(1..Number_Of_Hosts_Widgets);
    end record;

  type Node_Config_Ptr is access Node_Config_Type;

  type Node_Array is array (Positive range <>) of Node_Config_Ptr;

  type System_Config_Typ(Number_Of_Node_Widgets : Natural; 
	Number_Of_Hosts_Widgets : Natural) is
    record
      Number_of_nodes :  Natural := 0;
      Nodes : Node_Array(1..Number_Of_Node_Widgets) := 
	(others => new Node_Config_Typ(Number_Of_Hosts_Widgets));
    end record;

  type System_Config_Typ_Ptr is access System_Config_Typ;

Now you can create a heap-resident structure as follows:

    X : System_Config_Typ_Ptr := new System_Config_Typ(Num_Nodes, Num_Hosts);

--
-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Burlington, MA  USA
An AverStar Company




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: ??? Help!: how to do unconstraned arrays/records???
  1998-11-05  0:00 ` Tucker Taft
@ 1998-11-05  0:00   ` Tucker Taft
  1998-11-05  0:00     ` al johnston
  1998-11-05  0:00   ` Tucker Taft
  1 sibling, 1 reply; 16+ messages in thread
From: Tucker Taft @ 1998-11-05  0:00 UTC (permalink / raw)


Tucker Taft (stt@houdini.camb.inmet.com) wrote:
: al johnston (johnstona@avionics2.robins.af.mil) wrote:

: : HELP!!!!

: : I a trying to convert the following "static" ada data
: : structure to a structure that can be created dynamically,
: : ie via the "new" ada function, and setting the two
: : constrants at that time.

: How about:

:  type Host_Config_Typ is
:     record
:       ID        : Integer;
:       Label     : String;
:     end record;

:   type Host_Array is array (Positive range <>) of Host_Config_Typ;
:   type Host_Array_Ptr is access Host_Array;

:   type Node_Config_Typ(Number_Of_Hosts_Widgets : Natural := 0) is
:     record
:       ID              : integer;
:       Label           : String;
:       Number_of_hosts : Natural := 0;
:       Hosts           : Host_Array_Ptr := 
:         new Host_Array(1..Number_Of_Hosts_Widgets);
:     end record;

:   type Node_Array is array (Positive range <>) of Node_Config_Typ;

:   type System_Config_Typ(Number_Of_Node_Widgets : Natural; 
: 	Number_Of_Hosts_Widgets : Natural) is
:     record
:       Number_of_nodes :  Natural := 0;
:       Nodes : Node_Array(1..Number_Of_Node_Widgets) := 
: 	(others => Node_Config_Typ(Number_Of_Hosts_Widgets));

This isn't legal Ada.  I was inventing some kind of "default-initialized
aggregate" in my dreams.  The "simpler" solution I just posted also
has the advantage of not using any "wishful thinking" Ada, I believe ;-).

--
-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Burlington, MA  USA
An AverStar Company




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: ??? Help!: how to do unconstraned arrays/records???
  1998-11-05  0:00   ` dewarr
@ 1998-11-05  0:00     ` al johnston
  1998-11-05  0:00       ` dewar
  1998-11-05  0:00       ` Stephen Leake
  0 siblings, 2 replies; 16+ messages in thread
From: al johnston @ 1998-11-05  0:00 UTC (permalink / raw)


> Why are you using an obsolete language at this stage. I can understand the
> cases of large scale legacy projects that committed some time ago to the
> technology, but it is hard to believe that this is your case.

we have 500k of 83 code for an embedded system.  we build on a solaris
box, and the target is a force 2ce (sparc2) cpu card using vxWorks.

I have been unable to find a ada compiler vendor intrested in supporting
this configuration.  We are using VadsWorks which is now owned
by rational.... and surprizingly they were not intrested in providing
a version of there ada compiler (apex i think) even though they
already have a "native" compiler for the sparc....  really pissed me of
since they are the ones who killed vadsworks.

gnat sounded promisig, but I would have to port the ada runtime
for vxworks myself...  The real kicker was the screwy way
gnat does makes and handles file names and preprocessor directives.
well, its screwie relitive to the vads handles them.  it looks like it
would tak 6-8 man months to get ported to gnat, most of that spent
reformating files and creating make files....right now
the time is not there...

If you know something that I dont... please let me know!!!

-al





^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: ??? Help!: how to do unconstraned arrays/records???
  1998-11-05  0:00   ` Tucker Taft
@ 1998-11-05  0:00     ` al johnston
  0 siblings, 0 replies; 16+ messages in thread
From: al johnston @ 1998-11-05  0:00 UTC (permalink / raw)
  To: Tucker Taft



Tucker Taft wrote:

> This isn't legal Ada.  I was inventing some kind of "default-initialized
> aggregate" in my dreams.

Not being an ada programer at hart (my first love was pascal...) Itry to
"bluff" my way thourgh the syntax on occasions...  similer
to your "in my dreams" code.... I find the compiler is not very
compassionite to my dreams.... (g)

Your second version works greate.  Thanks for getting me throught
this.  The solution is not as "elegint" as one would wish for in a
perfict world... but I know ada84 is not perfect already<g>!

thanks for taking the time to help!!

-al





^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: ??? Help!: how to do unconstraned arrays/records???
  1998-11-05  0:00   ` Tucker Taft
@ 1998-11-05  0:00     ` Mats Weber
  1998-11-05  0:00       ` Tucker Taft
  0 siblings, 1 reply; 16+ messages in thread
From: Mats Weber @ 1998-11-05  0:00 UTC (permalink / raw)


Tucker Taft wrote:

>   type System_Config_Typ(Number_Of_Node_Widgets : Natural;
>         Number_Of_Hosts_Widgets : Natural) is
>     record
>       Number_of_nodes :  Natural := 0;
>       Nodes : Node_Array(1..Number_Of_Node_Widgets) :=
>         (others => new Node_Config_Typ(Number_Of_Hosts_Widgets));
>     end record;

This looks dangerous to me because declaring an object of that type will
allocate stuff from the heap, which may cause a memory leak. I would
prefer explicit allocation (i.e. no default initial value for Nodes).




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: ??? Help!: how to do unconstraned arrays/records???
  1998-11-05  0:00     ` Mats Weber
@ 1998-11-05  0:00       ` Tucker Taft
  1998-11-05  0:00         ` al johnston
  0 siblings, 1 reply; 16+ messages in thread
From: Tucker Taft @ 1998-11-05  0:00 UTC (permalink / raw)


Mats Weber (Mats.Weber@elca-matrix.ch) wrote:
: Tucker Taft wrote:

: >   type System_Config_Typ(Number_Of_Node_Widgets : Natural;
: >         Number_Of_Hosts_Widgets : Natural) is
: >     record
: >       Number_of_nodes :  Natural := 0;
: >       Nodes : Node_Array(1..Number_Of_Node_Widgets) :=
: >         (others => new Node_Config_Typ(Number_Of_Hosts_Widgets));
: >     end record;

: This looks dangerous to me because declaring an object of that type will
: allocate stuff from the heap, which may cause a memory leak. I would
: prefer explicit allocation (i.e. no default initial value for Nodes).

This won't allocate any heap objects if you specify 
Number_Of_Hosts_Widgets => 0 in the declaration.  

In any case, I would generally agree with you that types
which implicitly use the heap as part of their default initialization
are dangerous.  Since the exercise was to create a type for
heap allocation, it seemed OK to do it here.

--
-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Burlington, MA  USA
An AverStar Company




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: ??? Help!: how to do unconstraned arrays/records???
  1998-11-05  0:00     ` al johnston
  1998-11-05  0:00       ` dewar
@ 1998-11-05  0:00       ` Stephen Leake
  1 sibling, 0 replies; 16+ messages in thread
From: Stephen Leake @ 1998-11-05  0:00 UTC (permalink / raw)


al johnston <johnstona@avionics2.robins.af.mil> writes:

> > Why are you using an obsolete language at this stage. I can understand the
> > cases of large scale legacy projects that committed some time ago to the
> > technology, but it is hard to believe that this is your case.
> 
> we have 500k of 83 code for an embedded system.  we build on a solaris
> box, and the target is a force 2ce (sparc2) cpu card using vxWorks.
> 
> <snip> 
> gnat sounded promisig, but I would have to port the ada runtime
> for vxworks myself...  The real kicker was the screwy way
> gnat does makes and handles file names and preprocessor directives.
> well, its screwie relitive to the vads handles them.  it looks like it
> would tak 6-8 man months to get ported to gnat, most of that spent
> reformating files and creating make files....right now
> the time is not there...

I suggest you take another look. gnat uses the program 'gnatmake'
_instead of_ makefiles. VADS Ada 83 has nothing comparable. 

Also, gnat provides the utility 'gnatchop', which reads all your
current Ada files and outputs new files using the default gnat naming
conventions.

To convert from VADS to gnat, delete all makefiles, run gnatchop, then
run gnatmake. Presto! So this should take a couple hours, not six months!

-- Stephe





^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: ??? Help!: how to do unconstraned arrays/records???
  1998-11-05  0:00       ` Tucker Taft
@ 1998-11-05  0:00         ` al johnston
  1998-11-05  0:00           ` Tucker Taft
  0 siblings, 1 reply; 16+ messages in thread
From: al johnston @ 1998-11-05  0:00 UTC (permalink / raw)


> : This looks dangerous to me because declaring an object of that type will
> : allocate stuff from the heap, which may cause a memory leak. I would
> : prefer explicit allocation (i.e. no default initial value for Nodes).
>
> In any case, I would generally agree with you that types

I was about to ask how do I deallocate this... my impression is if have
to create a looping structure... correct?

re, memory leak... this code only gets called once (at start up) so the impact

of any leak is minor.

>are dangerous.  Since the exercise was to create a type for
>heap allocation, it seemed OK to do it here.

Taft,

actually that wasnt the exercise... although it is probably the way I
misstated
my original request that caused the confussion.... I dont really need the
alloc-
ation to be done on heap... but rather that the allocateion of memory to be
"sized" at run time rather than at compile time.  at run time i get the
numhosts
and numnodes and size the array at that time....  now that may dictate
that the memory be allocated on the heap rather than otherwise... I dont
know... i sure dont understand the details of ada...  But the only reason
we are using pointers and "new" is because I couldnt convins ada's to
handle my requirmens for a "unconstraned" data struture....

anyway, your sollution is fine for my app...  and I have not seen a better
one suggested..

thanks again....






^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: ??? Help!: how to do unconstraned arrays/records???
  1998-11-05  0:00         ` al johnston
@ 1998-11-05  0:00           ` Tucker Taft
  1998-11-06  0:00             ` Mats Weber
  0 siblings, 1 reply; 16+ messages in thread
From: Tucker Taft @ 1998-11-05  0:00 UTC (permalink / raw)


al johnston (johnstona@avionics2.robins.af.mil) wrote:

: >are dangerous.  Since the exercise was to create a type for
: >heap allocation, it seemed OK to do it here.

: Taft,
 ^^ Tucker 

: actually that wasnt the exercise... although it is probably the way I
: misstated
: my original request that caused the confussion.... I dont really need the
: alloc-
: ation to be done on heap... but rather that the allocateion of memory to be
: "sized" at run time rather than at compile time.  at run time i get the
: numhosts
: and numnodes and size the array at that time....  now that may dictate
: that the memory be allocated on the heap rather than otherwise... I dont
: know... i sure dont understand the details of ada...  But the only reason
: we are using pointers and "new" is because I couldnt convins ada's to
: handle my requirmens for a "unconstraned" data struture....

If that is all you needed to do, you could probably leave the structures 
exactly as they were originally, and just make the "constants"
Number_Of_Hosts.. and Number_Of_Nodes... be initialized at elaboration
time by calling a function.  E.g.:

   Number_Of_Hosts : constant Natural := Parameters.Get_Host_Count(...);
   Number_Of_Nodes : constant Natural := Parameters.Get_Node_Count(...);

and then go on to use these "constants" in your data
structure definitions as you were doing.  The only problem with
this approach is that doing significant work at elaboration
time can be tricky due to elaboration order problems -- you
might end up with Program_Error's being raised.

In the above example, you would certainly want a 
"pragma Elaborate(Parameters);" after the "with Parameters;" clause
on the package with this host/node data structure, to minimize the
chance of a Program_Error due to an elaboration order problem.

: anyway, your sollution is fine for my app...  and I have not seen a better
: one suggested..

Glad to hear it...

: thanks again....

--
-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Burlington, MA  USA
An AverStar Company




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: ??? Help!: how to do unconstraned arrays/records???
  1998-11-05  0:00           ` Tucker Taft
@ 1998-11-06  0:00             ` Mats Weber
  1998-11-06  0:00               ` Tucker Taft
  0 siblings, 1 reply; 16+ messages in thread
From: Mats Weber @ 1998-11-06  0:00 UTC (permalink / raw)


Tucker Taft wrote:

>    Number_Of_Hosts : constant Natural := Parameters.Get_Host_Count(...);
>    Number_Of_Nodes : constant Natural := Parameters.Get_Node_Count(...);
> 
> [...]
> 
> In the above example, you would certainly want a
> "pragma Elaborate(Parameters);" after the "with Parameters;" clause
> on the package with this host/node data structure, to minimize the
> chance of a Program_Error due to an elaboration order problem.

Probably "pragma Elaborate_All(Parameters);" would be safer, in case
Parameters depends on stuff that needs to be elaborated. Almost all uses
of pragma Elaborate should be replaced by Elaborate_All, I think.




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: ??? Help!: how to do unconstraned arrays/records???
  1998-11-06  0:00             ` Mats Weber
@ 1998-11-06  0:00               ` Tucker Taft
  0 siblings, 0 replies; 16+ messages in thread
From: Tucker Taft @ 1998-11-06  0:00 UTC (permalink / raw)


Mats Weber (Mats.Weber@elca-matrix.ch) wrote:

: > In the above example, you would certainly want a
: > "pragma Elaborate(Parameters);" after the "with Parameters;" clause
: > on the package with this host/node data structure, to minimize the
: > chance of a Program_Error due to an elaboration order problem.

: Probably "pragma Elaborate_All(Parameters);" would be safer, in case
: Parameters depends on stuff that needs to be elaborated. Almost all uses
: of pragma Elaborate should be replaced by Elaborate_All, I think.

True, but pragma Elaborate_All is defined only in Ada 95,
and the user's current development environment is Ada 83.

--
-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Burlington, MA  USA
An AverStar Company




^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~1998-11-06  0:00 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-11-04  0:00 ??? Help!: how to do unconstraned arrays/records??? al johnston
1998-11-04  0:00 ` Albert S. Johnston
1998-11-05  0:00   ` dewarr
1998-11-05  0:00     ` al johnston
1998-11-05  0:00       ` dewar
1998-11-05  0:00       ` Stephen Leake
1998-11-05  0:00 ` Tucker Taft
1998-11-05  0:00   ` Tucker Taft
1998-11-05  0:00     ` al johnston
1998-11-05  0:00   ` Tucker Taft
1998-11-05  0:00     ` Mats Weber
1998-11-05  0:00       ` Tucker Taft
1998-11-05  0:00         ` al johnston
1998-11-05  0:00           ` Tucker Taft
1998-11-06  0:00             ` Mats Weber
1998-11-06  0:00               ` Tucker Taft

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