From: "Matthew Heaney" <mheaney@on2.com>
Subject: Re: Ada Address = C pointer ?
Date: Mon, 29 Oct 2001 15:19:00 -0500
Date: 2001-10-29T15:19:00-05:00 [thread overview]
Message-ID: <ttre7mgvgm8pe4@corp.supernews.com> (raw)
In-Reply-To: mailman.1004357020.21840.comp.lang.ada@ada.eu.org
"M. A. Alves" <maa@liacc.up.pt> wrote in message
news:mailman.1004357020.21840.comp.lang.ada@ada.eu.org...
> You mean use Address_To_Access conversion? Because what I have is C
> pointers I need to interface with. I am using Chars_Ptr because it has a
> Null_Ptr value and I need to test for, and pass, NULL. (And in C char *
> is assuredly able to point to anything.) But I am indeed considering
> using Address et al., and Address to Access conversion.
The Ada type that corresponds to the C type char* is
Interfaces.C.Strings.chars_ptr. This is enunciated explicitly in RM95 B.3.1
(1) and (22).
Unfortunately, there is no binding to the C type void* -- this was omitted
from the standard (I assume by accident). I assume that there will be a
binding to void* in Ada0Y.
I think it's safe to assume that void* is the same as char*, so you should
be OK using C.Strings.chars_ptr where a void* is expected.
I do NOT think you need to use System.Address and Addr_To_Acc_Conv. The
types declared in C.Strings should be adequate. That being said, I would be
very surprised if System.Address had a different representation from char*
or void*.
next prev parent reply other threads:[~2001-10-29 20:19 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-10-26 18:53 Ada Address = C pointer ? M. A. Alves
2001-10-26 18:09 ` Lutz Donnerhacke
2001-10-26 21:06 ` Florian Weimer
2001-10-26 19:34 ` Mark Johnson
2001-10-26 23:39 ` tmoran
2001-10-29 13:07 ` M. A. Alves
2001-10-29 20:19 ` Matthew Heaney [this message]
2001-10-29 23:15 ` tmoran
2001-10-30 10:30 ` M. A. Alves
2001-10-30 19:53 ` tmoran
2001-10-31 13:01 ` M. A. Alves
2001-10-31 14:44 ` Marin David Condic
2001-10-30 9:58 ` M. A. Alves
2001-10-30 12:02 ` Lutz Donnerhacke
2001-10-30 12:53 ` M. A. Alves
2001-10-30 12:56 ` Lutz Donnerhacke
2001-10-30 14:26 ` M. A. Alves
2001-10-30 14:19 ` Matthew Heaney
2001-10-30 14:41 ` M. A. Alves
2001-10-30 17:10 ` Mark Johnson
2001-10-30 18:01 ` M. A. Alves
2001-10-30 20:23 ` tmoran
2001-10-31 13:13 ` M. A. Alves
2001-10-30 19:53 ` tmoran
2001-10-29 23:15 ` tmoran
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox