From: robert_dewar@my-dejanews.com
Subject: Re: How do I get this to work??
Date: 1999/01/06
Date: 1999-01-06T00:00:00+00:00 [thread overview]
Message-ID: <76uvb4$nth$1@nnrp1.dejanews.com> (raw)
In-Reply-To: uiuelbj6r.fsf@gsfc.nasa.gov
In article <uiuelbj6r.fsf@gsfc.nasa.gov>,
Stephen Leake <Stephen.Leake@gsfc.nasa.gov> wrote:
> Why does Close_Port need a pointer to a Session? If you
> are passing Session to C code, you should probably use
> 'Address rather than 'access. Or, define Close_Port to
> take an access parameter:
I consider both of these pieces of advice wrong.
It is Ada 83 thinking to go to untyped addresses for this
purpose. Pointers in Ada *and* C are typed, and passing
untyped pointers across the interface represents
unnecessary weakening of the typing system. It is far
better to use Access (or Unchecked_Access which is still
far safer than Address).
As for using an access parameter, there is a very big trap
here that people keep falling into. An access parameter may
NOT be null, and typical C interfaces can accept null
values. Also, using an access parameter does not obviate
the need for using 'Access, though of course it makes it
easier to use it.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
next prev parent reply other threads:[~1999-01-06 0:00 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-01-04 0:00 How do I get this to work?? Chris Warwick
1999-01-05 0:00 ` Tom Moran
1999-01-05 0:00 ` Chris Warwick
1999-01-05 0:00 ` Stephen Leake
1999-01-05 0:00 ` Tom Moran
1999-01-06 0:00 ` robert_dewar
1999-01-06 0:00 ` Larry Kilgallen
1999-01-06 0:00 ` Tom Moran
1999-01-06 0:00 ` Tom Moran
1999-01-07 0:00 ` robert_dewar
1999-01-07 0:00 ` Tom Moran
1999-01-10 0:00 ` robert_dewar
1999-01-10 0:00 ` Tom Moran
1999-01-10 0:00 ` robert_dewar
1999-01-10 0:00 ` robert_dewar
1999-01-10 0:00 ` Tom Moran
1999-01-10 0:00 ` Pat Rogers
1999-01-06 0:00 ` Tom Moran
1999-01-07 0:00 ` robert_dewar
1999-01-07 0:00 ` Tom Moran
1999-01-10 0:00 ` robert_dewar
1999-01-06 0:00 ` robert_dewar [this message]
1999-01-06 0:00 ` Chris Warwick
1999-01-06 0:00 ` Tom Moran
1999-01-07 0:00 ` Stephen Leake
1999-01-08 0:00 ` Simon Wright
1999-01-07 0:00 ` robert_dewar
1999-01-09 0:00 ` Chris Warwick
1999-01-09 0:00 ` Brian Rogoff
1999-01-10 0:00 ` Matthew Heaney
1999-01-09 0:00 ` Simon Wright
1999-01-10 0:00 ` robert_dewar
1999-01-11 0:00 ` Simon Wright
1999-01-16 0:00 ` Chris Warwick
1999-01-16 0:00 ` robert_dewar
1999-01-18 0:00 ` Chris Warwick
1999-01-18 0:00 ` Matthew Heaney
1999-01-16 0:00 ` Simon Wright
1999-01-16 0:00 ` Matthew Heaney
1999-01-16 0:00 ` robert_dewar
1999-01-18 0:00 ` Chris Warwick
1999-01-18 0:00 ` Matthew Heaney
1999-01-18 0:00 ` robert_dewar
1999-01-18 0:00 ` dennison
1999-01-18 0:00 ` Tucker Taft
1999-01-19 0:00 ` Chris Warwick
1999-01-19 0:00 ` robert_dewar
1999-01-20 0:00 ` Jeff Carter
1999-01-20 0:00 ` robert_dewar
1999-01-21 0:00 ` Chris Warwick
1999-01-19 0:00 ` Stephen Leake
1999-01-19 0:00 ` Tom Moran
1999-01-18 0:00 ` dennison
1999-01-06 0:00 ` Simon Wright
1999-01-22 0:00 ` Nick Roberts
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox