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-Thread: 103376,68536605ede13a20 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.212.232 with SMTP id nn8mr12439092pbc.1.1324151472091; Sat, 17 Dec 2011 11:51:12 -0800 (PST) Path: lh20ni34016pbb.0!nntp.google.com!news1.google.com!news.glorb.com!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: GNAT - return by anonymous access Date: Sat, 17 Dec 2011 19:51:10 +0000 Organization: A noiseless patient Spider Message-ID: References: <784c67eb-a542-41b0-b23d-fca1234e56b2@n10g2000vbg.googlegroups.com> Mime-Version: 1.0 Injection-Info: mx04.eternal-september.org; posting-host="dFCm8HWntFqmDIilBLqEJQ"; logging-data="7805"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1++/fFJs5yWJCKjI+cd8X3wONtiZShscgw=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (darwin) Cancel-Lock: sha1:6YI25W6BBuje1wmC7Ess8gZOs7U= sha1:SHWDgxskyiZRAZxSfOvc0E1FqT0= Content-Type: text/plain; charset=us-ascii Date: 2011-12-17T19:51:10+00:00 List-Id: Simon Belmont writes: > This ostensibly simple program prints strange results, and i'm rapidly > losing faith in the GNAT compiler (GNAT GPL 20110428). If anyone with > an alternative compiler can confirm or deny this output as spurious, I > would be much obliged. In short, when the declaration of 'bar' is > commented out, the program behaves as i would expect (output is '42'), > but when bar is present, the output is much different (output is > '4409264'). Or, if my line of reasoning is mixed up and this is > actually the appropriate behavior, I would be grateful for any > explanation. This surely can't be correct behaviour. Here, on Mac OS X (64-bit compilers), GNAT GPL 2011 prints 1 (0 if I make Test_Type non-limited). GCC 4.6.0 behaves as you expect.