comp.lang.ada
 help / color / mirror / Atom feed
* Does variable creation need Elaborate_Body?
@ 2017-11-15  2:10 Victor Porton
  2017-11-15  2:17 ` Victor Porton
  2017-11-15  9:56 ` AdaMagica
  0 siblings, 2 replies; 3+ messages in thread
From: Victor Porton @ 2017-11-15  2:10 UTC (permalink / raw)


package X is

  -- pragma Elaborate_Body;

  function F return Integer;

  procedure Init;

end X;

package body X is

  V: Integer;

  function F return Integer is
  begin
    return V;
  end;

  procedure Init is
  begin
    V := 123;
  end;

end X;

-------------------

Does the above program need Elaborate_Body pragma for elaboration of "V: 
Integer;"?

Intuitively, "V: Integer;" does nothing. But it is a declaration which needs 
to be elaborated.

Does it elaborate correctly without Elaborate_Body?

-- 
Victor Porton - http://portonvictor.org


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

end of thread, other threads:[~2017-11-15  9:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-15  2:10 Does variable creation need Elaborate_Body? Victor Porton
2017-11-15  2:17 ` Victor Porton
2017-11-15  9:56 ` AdaMagica

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