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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.66.5.226 with SMTP id v2mr8700688pav.22.1382976348783; Mon, 28 Oct 2013 09:05:48 -0700 (PDT) X-Received: by 10.49.11.180 with SMTP id r20mr50986qeb.33.1382976348558; Mon, 28 Oct 2013 09:05:48 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!y3no82916679pbx.0!news-out.google.com!rn2ni128679pbc.1!nntp.google.com!i2no6137340qav.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 28 Oct 2013 09:05:48 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=137.121.198.151; posting-account=cumtSQoAAABneUE0cNB48vDg9pu8LzVu NNTP-Posting-Host: 137.121.198.151 References: <4395468b-93d3-45f4-8bc0-91cd646ff1d9@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Warning: accessibility check failure with GNAT GPL 2013 From: sangomarco@gmail.com Injection-Date: Mon, 28 Oct 2013 16:05:48 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:17551 Date: 2013-10-28T09:05:48-07:00 List-Id: Le lundi 28 octobre 2013 16:49:28 UTC+1, Dmitry A. Kazakov a =E9crit=A0: > On Mon, 28 Oct 2013 08:23:40 -0700 (PDT), sangomarco@gmail.com wrote: >=20 >=20 >=20 > > Thanks for your quick response. I don't have enough experience with Ada= , >=20 > > please could you tell me more about the rule? I don't understand why th= is >=20 > > is not allow. >=20 >=20 >=20 > It is allowed, unfortunately. That is why you have got only warning, not = an >=20 > error. Unfortunately, because it does not make sense in 90% of cases in >=20 > practice. >=20 >=20 >=20 > > My goal is to create a main task which makes a successor >=20 > > tasks if necessarry. And, since I cannot use the sybtype mak to create = a >=20 > > new task in the current execution of a main task body as the following >=20 > > declaration >=20 >=20 >=20 > Use a named access type instead. E.g. >=20 >=20 >=20 > type Cyclic_Thread_Ptr is access all Cyclic_Thread: >=20 >=20 >=20 > Informally, "new" adapts to the expected access type. So does the anonymo= us >=20 > access type from its side. When both meet each other there is no >=20 > information available to determine the scope where the allocated object >=20 > would live. The language rules use the most conservative estimation of th= at >=20 > scope (the body of the subprogram), which in practice never corresponds t= o >=20 > the programmer's intent. The resulting accessibility check necessarily >=20 > fails at run time. Be glad you were warned by the compiler. > Thanks, I get it. -- best regards, Marc