comp.lang.ada
 help / color / mirror / Atom feed
From: Dave Thompson <david.thompson1@worldnet.att.net>
Subject: Re: calling an ada procedure from C++
Date: Sat, 22 Nov 2003 05:25:12 GMT
Date: 2003-11-22T05:25:12+00:00	[thread overview]
Message-ID: <8vptrvk97f2qgt065upvcpieeng5bhq3vq@4ax.com> (raw)
In-Reply-To: rMdub.47447$bQ3.38402@nwrdny03.gnilink.net

On Tue, 18 Nov 2003 00:32:23 GMT, "Frank J. Lhota"
<NOSPAM.lhota.adarose@verizon.net> wrote:

> 
> "Ludovic Brenta" <ludovic.brenta@insalien.org> wrote in message
> news:m38ymezgo4.fsf@insalien.org...
<snip>
> > The basic point remains: how each compiler passes structures between
> > efunctions is compiler-specific.  It is however possible, both in C
> > and in Ada, to specify the exact bit pattern for a stucture, and thus
> > to pass the structure back and forth.
> 
> Even that is not necessarily true for all C compilers! The standard allows a
> great deal of lattitude in the placement of bit field. According to the 89
> standard (I'm not sure about C99), if you define
> 
("latitude")

>     struct Jello
>     {
>     unsigned Flavor : 5
>     unsigned Servings : 3
>     };
> 
(need semicolon after each member-declaration)

> the compiler is free to implement this by placing Flavor in the high order
> bits or in the low order bits. This creates a portability problem that has
> resulted in the underuse of bit fields.
> 
Yes, unchanged in C99 6.7.2.1p10: "[t]he order of allocation of
bit-fields within [an allocation] unit" and "whether a bit-field that
[overflows] is put into the next unit or overlaps adjacent units" are
implementation-defined, which means they must be documented; and the
size of the allocation unit and (as a logical result) its alignment
are unspecified, which means they need not be documented.

<snip>
> The ACT people have provided support for interfacing to C++. In general, the
> ACT and GNU people are to be congraduated for tackling the issue of
> multi-language OO programming.
> 
("congratulated")

- David.Thompson1 at worldnet.att.net



  reply	other threads:[~2003-11-22  5:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-12 15:11 calling an ada procedure from C++ Anthony Moss
2003-11-17  4:04 ` red floyd
2003-11-17  7:37 ` tmoran
2003-11-17 10:38 ` Duncan Sands
2003-11-17 14:32   ` Hyman Rosen
2003-11-17 18:28     ` Frank J. Lhota
2003-11-18  0:03       ` Ludovic Brenta
2003-11-18  0:32         ` Frank J. Lhota
2003-11-22  5:25           ` Dave Thompson [this message]
2003-11-17 21:13 ` sk
replies disabled

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