comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Workqueues in Ada
Date: Sat, 28 Jul 2007 17:38:28 -0400
Date: 2007-07-28T17:38:28-04:00	[thread overview]
Message-ID: <wcczm1gyzsb.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: f8gaug$cjt$1@atlantis.news.tpi.pl

Wiktor Moskwa <wiktorDOTmoskwa@gmail.com> writes:

> On 28.07.2007, Robert A Duff <bobduff@shell01.TheWorld.com> wrote:
>> Wiktor Moskwa <wiktorDOTmoskwa@gmail.com> writes:
>>> GNAT GPL 2007 outputs:
>>> ======
>>> (Ada 2005) cannot copy object of a limited type (RM-2005 6.5(5.5/2))
>>> consider switching to return of access type
>>> =====
>>
>> I would be very interested in seeing the code that causes this.
>
> Here you are:

Well, thanks, but I really meant I'd like to see which part of PragmARC
is causing trouble.  I assume the following is a cut-down example,
right?

What about it, Jeff?  Do you plan to update your components to be Ada
2005 compatible?

> ======
> procedure Sample is
>
>    generic
>       type Element is limited private;
>    package Pkg is
>       function Get return Element;
>    end Pkg;
>
>    package body Pkg is
>       Item : Element;
>       
>       function Get return Element is
>       begin
>          return Item;

Right, this is illegal in Ada 2005.  The fix is probably to remove
"limited" from Element, above, but I'd have to see the actual code to be
sure.  The compiler suggests, "consider switching to return of access
type", but I think that's bogus.

Note that in Ada 95, the above "return" has some rather strange
behavior in some cases.  Still, the fact that it was legal Ada, and is
now illegal, is rather annoying.

- Bob

P.S. I was one of the people who worked on implementing the new Ada 2005
limited-types stuff in GNAT.



  reply	other threads:[~2007-07-28 21:38 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-28 17:00 Workqueues in Ada Wiktor Moskwa
2007-07-28 17:28 ` Dmitry A. Kazakov
2007-07-28 17:52   ` Wiktor Moskwa
2007-07-28 19:53     ` Simon Wright
2007-07-28 21:25       ` Wiktor Moskwa
2007-07-28 20:45     ` Dmitry A. Kazakov
2007-07-28 21:19       ` Wiktor Moskwa
2007-07-29  8:36         ` Dmitry A. Kazakov
2007-07-29 19:53           ` Wiktor Moskwa
2007-07-30  6:47             ` Niklas Holsti
2007-07-30 15:56               ` Matthew Heaney
2007-07-30 15:53             ` Matthew Heaney
2007-07-30 19:57               ` Wiktor Moskwa
2007-07-30 15:52           ` Matthew Heaney
2007-07-31 20:54             ` Wiktor Moskwa
2007-08-01  8:30               ` Dmitry A. Kazakov
2007-07-28 17:31 ` Jeffrey R. Carter
2007-07-28 17:56   ` Wiktor Moskwa
2007-07-28 20:18   ` Wiktor Moskwa
2007-07-28 20:48     ` Robert A Duff
2007-07-28 21:03       ` Wiktor Moskwa
2007-07-28 21:38         ` Robert A Duff [this message]
2007-07-28 22:12           ` Wiktor Moskwa
2007-07-29  0:30             ` Robert A Duff
2007-07-29  6:38               ` Jeffrey R. Carter
2007-07-29  6:34           ` Jeffrey R. Carter
2007-07-29  6:30     ` Jeffrey R. Carter
2007-07-28 21:54 ` Robert A Duff
2007-07-30 15:48 ` Matthew Heaney
replies disabled

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