comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.not.jrcarter@acm.not.spam.org>
Subject: Re: generic package with procedure paramter gives "not subtype conformant with declaration"
Date: Sun, 01 Oct 2006 01:27:38 GMT
Date: 2006-10-01T01:27:38+00:00	[thread overview]
Message-ID: <eQETg.174544$FQ1.97996@attbi_s71> (raw)
In-Reply-To: <1159651201.121690.130430@b28g2000cwb.googlegroups.com>

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;
> <end of code post>

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



  reply	other threads:[~2006-10-01  1:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-30 21:20 generic package with procedure paramter gives "not subtype conformant with declaration" cl1
2006-10-01  1:27 ` Jeffrey R. Carter [this message]
2006-10-01  6:02   ` cl1
2006-10-01 19:43     ` Jeffrey R. Carter
2006-10-01 21:26       ` cl1
2006-10-01 23:17         ` tmoran
2006-10-02  4:46           ` cl1
2006-10-02  3:24         ` Jeffrey R. Carter
2006-10-02  4:31           ` cl1
2006-10-02  7:17             ` Alex R. Mosteo
2006-10-02 20:04             ` Jeffrey R. Carter
2006-10-03 18:49               ` cl1
2006-10-01  7:18 ` Simon Wright
2006-10-01 19:42   ` cl1
2006-10-01 20:18     ` Robert A Duff
2006-10-01 21:32       ` cl1
replies disabled

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