From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7c47766edd175974 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-03 03:37:14 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: russian_power@hotmail.com (Romanov) Newsgroups: comp.lang.ada Subject: Re: How do package body initializers get run in GNU Ada? Date: 3 Nov 2002 03:37:14 -0800 Organization: http://groups.google.com/ Message-ID: References: <3DC31EBB.2050809@math.jpl.nasa.gov> NNTP-Posting-Host: 202.156.2.51 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1036323434 4683 127.0.0.1 (3 Nov 2002 11:37:14 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 3 Nov 2002 11:37:14 GMT Xref: archiver1.google.com comp.lang.ada:30319 Date: 2002-11-03T11:37:14+00:00 List-Id: Van Snyder wrote in message news:<3DC31EBB.2050809@math.jpl.nasa.gov>... > In GNU Ada, what mechanism is used to cause execution of package > body initializers, i.e., the code between begin and end in a > package body? > > Is it done using some kind of back-patching/overlaying done > by an otherwise garden-variety ld, by special features added > to ld to support Ada, by first-time flags at the entries > to procedures, or by something else? I thought it was done when the package was being elaborated? Package elaboration takes place when the package is instantiated. statements like 'with text_io;' executes the body initializers. Ada is much more precise about initialization that C/C++ is. That's why we have 'pragma elaborate(xxx);' statements but i use the dynamic elaboration feature in gnat. so much easier... you only get a problem when you try to use another joker who uses static elaboration instead...