From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2c25d9643f05ffd1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-21 21:25:13 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.mathworks.com!wn13feed!worldnet.att.net!bgtnsc04-news.ops.worldnet.att.net.POSTED!not-for-mail From: Dave Thompson Newsgroups: comp.lang.ada Subject: Re: calling an ada procedure from C++ Message-ID: <8vptrvk97f2qgt065upvcpieeng5bhq3vq@4ax.com> References: <3fb24ce4$1@baen1673807.greenlnk.net> <1069079554.9445@master.nyc.kbcfp.com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Sat, 22 Nov 2003 05:25:12 GMT NNTP-Posting-Host: 12.76.19.53 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1069478712 12.76.19.53 (Sat, 22 Nov 2003 05:25:12 GMT) NNTP-Posting-Date: Sat, 22 Nov 2003 05:25:12 GMT Organization: AT&T Worldnet Xref: archiver1.google.com comp.lang.ada:2840 Date: 2003-11-22T05:25:12+00:00 List-Id: On Tue, 18 Nov 2003 00:32:23 GMT, "Frank J. Lhota" wrote: > > "Ludovic Brenta" wrote in message > news:m38ymezgo4.fsf@insalien.org... > > 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. > 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