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: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!mx05.eternal-september.org!feeder.eternal-september.org!xmission!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 10:44:53 -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> <2326c0e0-0eae-4259-bca1-049666ce9653@googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1371739494 27120 192.74.137.71 (20 Jun 2013 14:44:54 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 20 Jun 2013 14:44:54 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:H8HxJl0qMrV6LPzbuoFehNufqBU= Xref: news.eternal-september.org comp.lang.ada:15866 Date: 2013-06-20T10:44:53-04:00 List-Id: Adam Beneschan writes: > On Wednesday, June 19, 2013 5:57:35 PM UTC-7, Robert A Duff wrote: > >> And with standard Ada, it's even worse: the order can change for any >> reason, or for no reason. The implementation is allowed to roll dice >> to determine the order! Even running the exact same program without >> recompiling could change order! > > You say that like it's a bad thing. Yes, I do. ;-) > Actually, I can see a use for a compiler option to use a random number > generator to determine the elaboration order (or other things that are > implementation-dependent), because if the program relies on the order > when it shouldn't, a random order will increase the chance that > repeated testing will expose the problem. Yes, I agree that would be useful. But only as an option, and only for testing. It would be a useful option even if Ada were designed as I've been saying it should (such that elaboration order is deterministic/portable). If the rule was "lexicographic order", as I have suggested, I still don't think programmers should depend on lexicographic order, and this option could help prevent that. - Bob