comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: GNAT - return by anonymous access
Date: Sat, 17 Dec 2011 19:51:10 +0000
Date: 2011-12-17T19:51:10+00:00	[thread overview]
Message-ID: <m28vmb7z9t.fsf@pushface.org> (raw)
In-Reply-To: 784c67eb-a542-41b0-b23d-fca1234e56b2@n10g2000vbg.googlegroups.com

Simon Belmont <sbelmont700@gmail.com> 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.



  reply	other threads:[~2011-12-17 19:51 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-17 19:17 GNAT - return by anonymous access Simon Belmont
2011-12-17 19:51 ` Simon Wright [this message]
2011-12-18  9:08 ` Georg Bauhaus
2011-12-19 23:46 ` Randy Brukardt
2011-12-20  0:14   ` Shark8
2011-12-20 23:18     ` Randy Brukardt
2011-12-21  0:44       ` Simon Belmont
2011-12-21  7:29         ` AdaMagica
2011-12-21 11:05           ` Georg Bauhaus
2011-12-21 11:43             ` AdaMagica
2011-12-21 12:05               ` Georg Bauhaus
2011-12-22  0:33                 ` Randy Brukardt
2011-12-22  0:33           ` Simon Belmont
2011-12-22  7:11             ` Adam Beneschan
2011-12-22 22:11               ` Simon Belmont
2011-12-23  0:56                 ` Randy Brukardt
2011-12-23 13:20                   ` Simon Belmont
2011-12-27 23:51                     ` Randy Brukardt
2011-12-20 23:53 ` anon
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox