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,WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,23ca868289d9f0c X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns13feed!worldnet.att.net!attbi_s71.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" Organization: jrcarter at acm dot org User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: generic package with procedure paramter gives "not subtype conformant with declaration" References: <1159651201.121690.130430@b28g2000cwb.googlegroups.com> In-Reply-To: <1159651201.121690.130430@b28g2000cwb.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 12.201.97.213 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s71 1159666058 12.201.97.213 (Sun, 01 Oct 2006 01:27:38 GMT) NNTP-Posting-Date: Sun, 01 Oct 2006 01:27:38 GMT Date: Sun, 01 Oct 2006 01:27:38 GMT Xref: g2news2.google.com comp.lang.ada:6817 Date: 2006-10-01T01:27:38+00:00 List-Id: cl1 wrote: > --avcall-register_type.adb:13:34: not subtype conformant with > declaration at avcall.ads:37 > --avcall-register_type.adb:13:34: formal subprograms not allowed > Info.Av_Param := Av_Param_Instance'Access; > You seem to have cut things down a bit too much. avcall.ads has no line 37. If you're going to cut things down this much, please post messages that result from compiling the cut-down code. You shouldn't use System.Address to interface to C. Use a convention-C access type instead. > I don't understand why i can't pass Av_Param to the generic package (in > test_call_avcall_register_type.adb) and have its 'Access attribute used > in Concat (the offending code in avcall-register_type.adb)? You don't say what version of GNAT you're using. However, I suspect what you're running into is an accessibility control problem. You can't store the generic formal procedure's 'access because the compiler can't be sure that the life of the access value is no longer than the life of the actual procedure. -- Jeff Carter "Sir Lancelot saves Sir Gallahad from almost certain temptation." Monty Python & the Holy Grail 69