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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e5140c483354bfcc X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!wns13feed!worldnet.att.net!attbi_s53.POSTED!53ab2750!not-for-mail From: "Steve" Newsgroups: comp.lang.ada References: <3fc90377.0411171620.7a3bcfd9@posting.google.com> <30430rF2qcqp0U1@uni-berlin.de> <3046atF2qaqsjU1@uni-berlin.de> Subject: Re: What is correct way to pack records X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Message-ID: NNTP-Posting-Host: 24.22.63.157 X-Complaints-To: abuse@comcast.net X-Trace: attbi_s53 1100833710 24.22.63.157 (Fri, 19 Nov 2004 03:08:30 GMT) NNTP-Posting-Date: Fri, 19 Nov 2004 03:08:30 GMT Organization: Comcast Online Date: Fri, 19 Nov 2004 03:08:30 GMT Xref: g2news1.google.com comp.lang.ada:6282 Date: 2004-11-19T03:08:30+00:00 List-Id: Just to complicate matters, with Microsoft C/C++ you have pragmas: #pragma pack(1) So that the packing in the C code may be varied. Steve (The Duck) "Marc A. Criley" wrote in message news:3046atF2qaqsjU1@uni-berlin.de... > "Jeffrey Carter" wrote: > > > Marc A. Criley wrote: > > > > > Yes. Though it carries some baggage that may or may not matter to you. > > > > > > pragma Convention(C, MyRec); > > > > This may guarantee the order, but it doesn't guarantee packing, and the > > results may vary from one compiler to another. > > Correct, that's why it's essential that the layout of the record definition > be verified against the file record layout. > > I my experience (with GNAT and Rational Apex) I find that "Convention C" > does do the "right" thing, especially since it's supposed to conform to how > a C compiler would lay out the data. > > Marc > >