Re: volatile vs aliased
- From: "Jeffrey R. Carter" <spam@xxxxxxxx>
- Date: Thu, 06 Oct 2005 18:40:51 GMT
Randy Brukardt wrote:
This seems like a good time to mention that I think the explicit use of System.Address in Ada 95 and Ada 200Y code is usually a mistake. Since pragma Convention can be used to ensure that general access types have the appropriate representation, its rare that Address needs to be used for interfacing. (There is only a handful of uses of Address in Claw, for example.)
I'd go further. First, I see if I can use an out or in out parameter of a Convention-C non-access type, rather than use a Convention-C access type. Most pointer parameters in C exist to get the effect of out or in out parameters, and "pragma Import (C, ..." will do the right thing for you without messing with access types.
Of course, if the C function has both pointer parameters and returns a value, access parameters are the only thing available. Is ease of interfacing to other languages another pro for allowing out and in out parameters for functions, along with making side effects visible?
-- Jeff Carter "I soiled my armor, I was so scared." Monty Python & the Holy Grail 71 .
- Follow-Ups:
- Re: volatile vs aliased
- From: Robert A Duff
- Re: volatile vs aliased
- References:
- volatile vs aliased
- From: REH
- Re: volatile vs aliased
- From: Ludovic Brenta
- Re: volatile vs aliased
- From: Randy Brukardt
- volatile vs aliased
- Prev by Date: Re: volatile vs aliased
- Next by Date: Re: volatile vs aliased
- Previous by thread: Re: volatile vs aliased
- Next by thread: Re: volatile vs aliased
- Index(es):
Relevant Pages
|