comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Interfacing Ada to C
Date: 1997/06/07
Date: 1997-06-07T00:00:00+00:00	[thread overview]
Message-ID: <dewar.865689618@merv> (raw)
In-Reply-To: EB26Lx.9Cu@world.std.com


Bob Duff said

<<Agreed that Pack shouldn't be used for interfacing purposes.  But you
don't always need to use record rep_clauses -- you can often use pragma
Convention(C or whatever) instead.  Record rep clauses are a pain during
maintenance -- they (over)specify all those bit numbers, when all you
really want to say is, "Do it like the corresponding C struct", or "lay
it out in order, using sensible alignment considerations."
>>

In GNAT, it is well defined that a packed record with Convention C has
identical layout to the corresponding C type in which each field has the
length in bits coresponding to the size of the Ada type, we have found
this quite useful.





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

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-05-29  0:00 Interfacing Ada to C Rune Wemberg
1997-05-29  0:00 ` Robert Dewar
1997-05-29  0:00 ` Samuel Tardieu
1997-05-30  0:00   ` Matthew Heaney
1997-05-31  0:00     ` Robert A Duff
1997-06-07  0:00       ` Robert Dewar [this message]
1997-05-30  0:00   ` Robert A Duff
1997-05-30  0:00 ` Robert A Duff
  -- strict thread matches above, loose matches on Subject: below --
1999-06-14  0:00 Drew
1999-06-14  0:00 Drew
1999-06-14  0:00 ` Steve Quinlan
replies disabled

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