comp.lang.ada
 help / color / mirror / Atom feed
From: "Mark Lundquist" <mark@rational.com>
Subject: Re: How pass a "null" as a parameter of anonymous access type
Date: Mon, 26 Mar 2001 19:17:51 GMT
Date: 2001-03-26T19:17:51+00:00	[thread overview]
Message-ID: <zBMv6.627492$U46.19173114@news1.sttls1.wa.home.com> (raw)
In-Reply-To: 3ABE6443.4119AB52@t-online.de


Freddy <Alfred.Hilscher.X@t-online.de> wrote in message
news:3ABE6443.4119AB52@t-online.de...
> Thanks. I've tried it, but at runtime I always get a constraint_error
> (GNAT seems to check the passing of "null" values).

Yes -- as any correct Ada compiler must do!

The value "null" just does not exist for the type of the parameter.

Now, you might be able use "pragma Suppress (Access_Check)" to defeat this.

But it seems like any Ada binding to C that uses access parameters for
things that you are supposed to be able to pass a null value is in error,
plain and simple!

Why can't you write your own corrected version of the subprogram
declaration, write your own "pragma Import (C, ..." for it, and use the
corrected version instead of the erroneous one?  Then you're not actually
"changing" it, just not using it... and instead using something else that is
very similar... :-)

Mark Lundquist
Rational Software






  reply	other threads:[~2001-03-26 19:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-22 20:04 How pass a "null" as a parameter of anonymous access type Freddy
2001-03-22 21:02 ` tmoran
2001-03-25 21:32   ` Freddy
2001-03-26 14:31     ` How pass a Ted Dennison
2001-03-23  9:05 ` How pass a "null" as a parameter of anonymous access type Thierry Lelegard
2001-03-25 21:33   ` Freddy
2001-03-26 19:17     ` Mark Lundquist [this message]
2001-03-27 16:13       ` Alfred Hilscher
2001-03-27 16:53       ` Thierry Lelegard
2001-03-26 13:44 ` Marc A. Criley
2001-03-26 19:35   ` Mark Lundquist
2001-03-27 12:59     ` Marc A. Criley
2001-03-27 16:12       ` Alfred Hilscher
replies disabled

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