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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3a414836333dfef7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-01-04 16:50:37 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: dewar@gnat.com (Robert Dewar) Newsgroups: comp.lang.ada Subject: Re: Elaboration in GNAT Date: 4 Jan 2002 16:50:37 -0800 Organization: http://groups.google.com/ Message-ID: <5ee5b646.0201041650.208d0918@posting.google.com> References: <1006952193.650930@edh3> <5ee5b646.0111281125.7e9fbca3@posting.google.com> <1010151875.216658@edh3> NNTP-Posting-Host: 205.232.38.14 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1010191837 4015 127.0.0.1 (5 Jan 2002 00:50:37 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 5 Jan 2002 00:50:37 GMT Xref: archiver1.google.com comp.lang.ada:18573 Date: 2002-01-05T00:50:37+00:00 List-Id: Some things to remember here: 1. The static elaboration model of GNAT is primarily intended for the development of new code. 2. If you are using GNAT in static mode, and do not intend to port the code to other compilers, it is a waste of time to mess around adding pragma Elaborate_All's, as was correctly noted in this thread, the -gnatwl warning is useful ONLY if you want to make sure that your code remains portable to other compilers without worrying about elaboration order messing things up. 3. If you are working with legacy code, it often makes no sense to try to use the static model of GNAT, and you should simply use -gnatE, and use the RM dynamic elaboration model. I am always surprised by people who are absolutely determined to beat legacy code into submission to the GNAT static model. Yes, of course this makes life easier in the future, but you have to be sure it is worth the work. 4. If you are working with legacy code, which has complex elaboration requirements, it is *highly* likely that the' code has serious bugs in it -- namely it does not have all the pragma Elaborate statements that should be there. 5. If you have buggy code of this kind, then you are between a rock and a hard place. rock = work required to meet GNAT static model hard place = work required to stick in all the pragmas It can often be very difficult to decide which way to go But always remember that the GNAT static model is an optional additional facility. It can never make porting harder, because you can always proceed as though it is not there. The reason it is the default is so that those lucky Ada programmers who know nothing about the horrors of elaboration who are writing new code will find it impossible to dig themselves into elaboration hell unawares :-) Robert Dewar