comp.lang.ada
 help / color / mirror / Atom feed
* Elaboration Problem
@ 1999-06-09  0:00 Decker, Christian R
  1999-06-09  0:00 ` Matthew Heaney
  1999-06-15  0:00 ` Stephen Leake
  0 siblings, 2 replies; 4+ messages in thread
From: Decker, Christian R @ 1999-06-09  0:00 UTC (permalink / raw)


I have a constant being declared inside a generic where the value being used
for the constant is obtained from
a lookup table.  Later on in a subprogram the constant value is used rather
than the lookuptable and to my suprise
the constant is not correct.

if i do a comparison between the constant and the lookup table value in the
same subprogram they are not equal.

Has anyone ever seen behavior like this?

Is this an elaboration problem where  the constant is being assigned a value
before the Ada package that the
lookup table resides in elaborates?

any suggestions?



   -**** Posted from RemarQ, http://www.remarq.com/?a ****-
 Search and Read Usenet Discussions in your Browser - FREE -




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

* Re: Elaboration Problem
  1999-06-09  0:00 Elaboration Problem Decker, Christian R
@ 1999-06-09  0:00 ` Matthew Heaney
  1999-06-15  0:00 ` Stephen Leake
  1 sibling, 0 replies; 4+ messages in thread
From: Matthew Heaney @ 1999-06-09  0:00 UTC (permalink / raw)


On 09 Jun 1999 06:26, cdecker@snet.net (Decker, Christian R) wrote:

> I have a constant being declared inside a generic where the value being used
> for the constant is obtained from
> a lookup table.  Later on in a subprogram the constant value is used rather
> than the lookuptable and to my suprise
> the constant is not correct.
> 
> if i do a comparison between the constant and the lookup table value in the
> same subprogram they are not equal.
> 
> Has anyone ever seen behavior like this?
> 
> Is this an elaboration problem where  the constant is being assigned a value
> before the Ada package that the
> lookup table resides in elaborates?
> 
> any suggestions?


Post some elided code, and we will try to diagnose the problem.  Without
actual code, it's difficult to understand what's going on.

Also, please state what language you're using (83 vs 95), and which
compiler.







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

* Re: Elaboration Problem
  1999-06-09  0:00 Elaboration Problem Decker, Christian R
  1999-06-09  0:00 ` Matthew Heaney
@ 1999-06-15  0:00 ` Stephen Leake
  1999-06-25  0:00   ` Robert Dewar
  1 sibling, 1 reply; 4+ messages in thread
From: Stephen Leake @ 1999-06-15  0:00 UTC (permalink / raw)


cdecker@snet.net (Decker, Christian R) writes:

> I have a constant being declared inside a generic where the value being used
> for the constant is obtained from
> a lookup table.  Later on in a subprogram the constant value is used rather
> than the lookuptable and to my suprise
> the constant is not correct.
> 
> if i do a comparison between the constant and the lookup table value in the
> same subprogram they are not equal.
> 
> Has anyone ever seen behavior like this?
> 
> Is this an elaboration problem where  the constant is being assigned a value
> before the Ada package that the
> lookup table resides in elaborates?
> 
> any suggestions?

Elaboration order problems should raise Program_Error; make sure you
have elaboration checks turned on.

Otherwise, post the code, so we can see what the code is really doing
(often different from what you thought you wanted the code to do :).

-- Stephe




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

* Re: Elaboration Problem
  1999-06-15  0:00 ` Stephen Leake
@ 1999-06-25  0:00   ` Robert Dewar
  0 siblings, 0 replies; 4+ messages in thread
From: Robert Dewar @ 1999-06-25  0:00 UTC (permalink / raw)


In article <uaeu1xx6y.fsf@gsfc.nasa.gov>,
  Stephen Leake <Stephen.Leake@gsfc.nasa.gov> wrote:
> Elaboration order problems should raise Program_Error; make
> sure you have elaboration checks turned on.

Note that the above advice is probably misleading when using
GNAT, since elaboration checking is by default done statically
at compile time (this is a simplification -- see the chapter
on elaboration checking in the GNAT user's guide).

Robert Dewar
Ada Core Technologies


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




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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-09  0:00 Elaboration Problem Decker, Christian R
1999-06-09  0:00 ` Matthew Heaney
1999-06-15  0:00 ` Stephen Leake
1999-06-25  0:00   ` Robert Dewar

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