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,LOTS_OF_MONEY autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e13b2443cdd722bd X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-12-01 08:43:21 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: dewar@gnat.com (Robert Dewar) Newsgroups: comp.lang.ada Subject: Re: Constant elaboration order Date: 1 Dec 2001 08:43:21 -0800 Organization: http://groups.google.com/ Message-ID: <5ee5b646.0112010843.6ad01bc3@posting.google.com> References: <3c0800dc$0$211$626a54ce@news.free.fr> NNTP-Posting-Host: 205.232.38.14 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1007225001 9225 127.0.0.1 (1 Dec 2001 16:43:21 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 1 Dec 2001 16:43:21 GMT Xref: archiver1.google.com comp.lang.ada:17278 Date: 2001-12-01T16:43:21+00:00 List-Id: Ted Dennison wrote in message news:... > No. However, I know of no compiler that actually does > that. This is misinformation. For a given compiler, you can be certain that the order of elaboration will be consistent, assuming that the order of compilation is consistent (for source based systems that do not have a required order of elaboration, the latter condition is likely irrelevant, it certainly is irrelevant for GNAT). > The DEC Ada compiler > was capable of changing it from compile to compile. (It > would optimize harder if > it happened to have more resources available at compile > time). I understand that this purports to be a counter example. I believe this is misinformation as well. Probably the confusion here is that of course in a traditional Ada 83 system, the elaboration order can depend on the order of compilation, because of inlining, but for a given order of compilation you will of course get a consistent elaboration order. However, big however! that order may well differ from one compiler to another, or from one version of the same compiler to another. For information on elaboration, read the chapter on the subject in the GNAT user's guide. I wrote that chapter, and as far as I know it is the most comprehensive treatment of the subject. It is of course tied into the way GNAT does things, but even if you are not using GNAT, you can learn a lot from this chapter. Robert Dewar