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=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.ams3.giganews.com!border2.nntp.ams3.giganews.com!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!feeder2-2.proxad.net!proxad.net!feeder1-2.proxad.net!feeder.erje.net!us.feeder.erje.net!nntp.club.cc.cmu.edu!128.2.129.101.MISMATCH!nntp.ece.cmu.edu!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Elaboration order handling (Was: Bug in 'gnatmake') Date: Thu, 20 Jun 2013 11:23:46 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <7f33982d-3bcf-452e-a3b3-3a0a28505ff1@x20g2000vbe.googlegroups.com> <87r4g0g9c0.fsf@adaheads.sparre-andersen.dk> <87ip1bg4z2.fsf_-_@adaheads.sparre-andersen.dk> <53d0b070-a03b-43d0-a560-68dd3a8bebf5@googlegroups.com> <51c218df$0$6623$9b4e6d93@newsspool2.arcor-online.net> <51c2e65c$0$6634$9b4e6d93@newsspool2.arcor-online.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1371741827 29478 192.74.137.71 (20 Jun 2013 15:23:47 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 20 Jun 2013 15:23:47 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:ZC3MAW0naRE/fiaafGOuCRL6D8k= X-Original-Bytes: 3098 Xref: number.nntp.dca.giganews.com comp.lang.ada:181993 Date: 2013-06-20T11:23:46-04:00 List-Id: "G.B." writes: > Well, programmers will depend on anything that is known, > more so if the standard defines it. (Like INT_MAX/Max_Int > is 2**31-1, you know...) True. But Ada is supposed to catch errors as early as possible. The case I'm complaining about here (where the programmer accidentally depends on the order chosen by some compiler, when that order is not required by the RM) is not caught at compile time. It's not caught at link time. It's not caught at run time during testing, nor by your customers. It's caught 4 years later, when the programmer who made the mistake is gone, and some other programmer tries to port to a different Ada compiler. That's a huge waste of money. Anyway, the language design should focus on preventing mistakes, rather than preventing incompetent programmers from doing damage -- the latter is a fool's errand. > However, a configuration pragma for elaboration should be fine? > It says, > "Take this way of walking the dependency graph" > > Stating the way then prevents configuration from being an > implicit consequence of the LRM. It also adds a way of > testing different paths of elaboration. We already have too many elaboration-control pragmas. I'm not sure adding another one is the right approach. Having said that, GNAT does support something like what you suggest -- as a switch, not a pragma. - Bob