comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Elaboration circularity with generics
Date: Mon, 16 Jan 2012 13:52:34 -0800 (PST)
Date: 2012-01-16T13:52:34-08:00	[thread overview]
Message-ID: <f8e81320-bcc9-4132-b38a-2851016879a1@k10g2000yqk.googlegroups.com> (raw)
In-Reply-To: 2ffd449a-2eee-4127-8cdb-7c42bcfd9e60@a40g2000vbu.googlegroups.com

On Jan 16, 1:29 pm, Maciej Sobczak <see.my.homep...@gmail.com> wrote:
> On Jan 16, 3:34 pm, Robert A Duff <bobd...@shell01.TheWorld.com>
> wrote:
>
> > > In such a case I would consider it to be a compiler bug.
>
> > I don't see any compiler bug here.
>
> What I'm concerned about is portability. If the compiler is allowed to
> refuse my program even though there is no paragraph saying that my
> program is illegal, then perhaps some other compiler will compile it
> without any trouble. Which means that my program will not be portable,
> even though it might not touch any implementation limits or other
> similarly valid reasons.

The problem is that without any additional Elaborate pragmas, a
compiler *could* compile the program, but it would be useless as it
would raise Program_Error right away.  Another compiler might build
the program and choose a different elaboration order that doesn't
raise Program_Error.  Neither of these compilers would be wrong, since
the language doesn't specify the exact elaboration order when there is
more than one that obeys the Elaborate pragmas and other language
rules.  So your program as written isn't portable at all; and even
though technically a compiler should accept the program, if you're
concerned about portability then you should be grateful that GNAT (in
its non-standard mode) rejected the program and alerted you to the
portability problem in your code.  I don't think you have a legitimate
complaint about GNAT here, at least not on portability grounds.

                             -- Adam



  reply	other threads:[~2012-01-16 21:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-14 15:09 Elaboration circularity with generics Maciej Sobczak
2012-01-14 16:13 ` Martin Dowie
2012-01-14 16:17 ` AdaMagica
2012-01-14 22:46   ` Simon Wright
2012-01-15 16:55     ` AdaMagica
2012-01-16 15:09       ` Simon Wright
2012-01-16 17:15         ` AdaMagica
2012-01-14 16:26 ` AdaMagica
2012-01-14 22:01 ` Georg Bauhaus
2012-01-15 17:15   ` Maciej Sobczak
2012-01-15 17:43     ` AdaMagica
2012-01-16 17:02       ` Adam Beneschan
2012-01-16 14:34     ` Robert A Duff
2012-01-16 21:29       ` Maciej Sobczak
2012-01-16 21:52         ` Adam Beneschan [this message]
2012-01-16 22:25         ` Robert A Duff
replies disabled

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