From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Potential Coextension Bug in GNAT
Date: Thu, 20 Dec 2018 20:16:09 -0600
Date: 2018-12-20T20:16:09-06:00 [thread overview]
Message-ID: <pvhid9$r7u$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: lyefacdtn8.fsf@pushface.org
"Simon Wright" <simon@pushface.org> wrote in message
news:lyefacdtn8.fsf@pushface.org...
> Jere <jhb.chat@gmail.com> writes:
>
>> I was messing around and trying to learn coextensions and
>> I came across some counter intuitive functionality. If I
>> directly initialize one via an aggregate, it works fine.
>> However, if I initialize through a constructing function,
>> it seems to treat the access discriminant as a normal access
>> type and finalizes it at the end of the program instead of
>> when the object leaves scope.
>
> Compiling with -gnatwa I see "warning: coextension will not be finalized
> when its associated owner is deallocated or finalized", so GNAT clearly
> meant to do it!
This message is nonsense, because a coextension is effectively part of the
associated object. What they presumably mean to say is that the declaration
in question is *not* a coextension, thus it will not be finalized with the
owner.
Randy.
P.S. I hate coextensions. One of the least necessary complications of Ada.
(Janus/Ada gives you a "feature not implemented" message if you try to
create one.)
next prev parent reply other threads:[~2018-12-21 2:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-20 15:59 Potential Coextension Bug in GNAT Jere
2018-12-20 16:02 ` Jere
2018-12-20 16:56 ` Simon Wright
2018-12-21 2:16 ` Randy Brukardt [this message]
2018-12-21 11:24 ` Jere
2018-12-20 17:58 ` Simon Wright
2018-12-21 2:25 ` Randy Brukardt
2018-12-21 11:32 ` Jere
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox