comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: how to pass access string across pragma C interface?
Date: 1997/06/23
Date: 1997-06-23T00:00:00+00:00	[thread overview]
Message-ID: <dewar.867078965@merv> (raw)
In-Reply-To: 01bc7f0c$494ab860$428371a5@dhoossr.iquest.com


David says

<<Assuming that the bit pattern for an access value and a C pointer are
identical on your
platform (this assumption is implicit in your interface pragma), then you
should
do something like:
buffer : string_access_type := new string (1 .. 2048);
>>


It is reasonable to assume that pointers to constrained array types are
easily mapped to C pointers, but it is asking for trouble to pass
pointers to unconstrained types. That is because the bounds information
must be somehow present, and C cannot know anything about it.

Thus code that passes such pointers to C, and even more code that receives
such pointers FROM C, is liable to be highly implementation dependent.





  reply	other threads:[~1997-06-23  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-19  0:00 how to pass access string across pragma C interface? burch
1997-06-20  0:00 ` Anonymous
1997-06-22  0:00 ` David C. Hoos, Sr.
1997-06-23  0:00   ` Robert Dewar [this message]
1997-06-25  0:00     ` Alan Brain
1997-06-24  0:00 ` Matthew Heaney
replies disabled

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