comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@bix.com
Subject: Re: access aliased obstacle
Date: 1996/07/09
Date: 1996-07-09T00:00:00+00:00	[thread overview]
Message-ID: <4rsmn6$hvc@news1.delphi.com> (raw)


>Are you trying to interface a C union (array of)? If it's the case,
>I think the use of Unchecked_Union may be of interest (and I believe
>it will be portable between Ada 95 implementation).
  I think of a C union as essentially a variant record with the
discriminant outside the record (in some other variable entirely).
C probably does think of this as a union, although it fits an Ada
discriminated record perfectly.  What is this 'Unchecked_Union'?
I don't see it in my LRM.

>non-limited types.  So, just make type Elements limited (i.e. change "is
>record" to "is limited record") and it will be OK.  There is some
  This is a glue package between Ada and a set of OS routines.  It would
be inconvenient, and hard to explain to users, why these discriminated
records ought to be 'limited'.  So right now I do an Unchecked_Conversion
to a local array of undiscriminated, and thus aliasable, records.  Since
it's in an OS call, and we're not talking enormous arrays, the marginal
performance hit is bearable.  But it sure isn't pretty.




             reply	other threads:[~1996-07-09  0:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-07-09  0:00 tmoran [this message]
1996-07-09  0:00 ` access aliased obstacle Laurent Guerby
1996-07-09  0:00   ` Robert Dewar
1996-07-10  0:00     ` Robert A Duff
1996-07-09  0:00 ` Laurent Guerby
1996-07-09  0:00   ` Robert Dewar
1996-07-09  0:00 ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1996-07-04  0:00 tmoran
1996-07-04  0:00 ` Robert Dewar
1996-07-06  0:00 ` Laurent Guerby
1996-07-07  0:00 ` Robert A Duff
replies disabled

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