comp.lang.ada
 help / color / mirror / Atom feed
From: wom@inel.gov (Warren O. Merrill)
Subject: What is correct way to pack records
Date: 17 Nov 2004 16:20:41 -0800
Date: 2004-11-17T16:20:41-08:00	[thread overview]
Message-ID: <3fc90377.0411171620.7a3bcfd9@posting.google.com> (raw)

I want my record structures to byte align (for compatibility with
existing files).  I know about using the record representation clause
to lay them out.  I have a LOT of these to do and just wondering if
any of the pragmas would be guaranteed to byte align my fields but NOT
change the order of the fields to do it (NOTE THAT IS IMPORTANT!!!!!).

So instead of:

type MyRec is record
  Fld1 : character;
  Fld2 : character;
  Fld3 : character;
end record;

for MyRec use record
  Fld1 at 0 range 0 .. 7;
  Fld2 at 1 range 0 .. 7;
  Fld3 at 2 range 0 .. 7;
end record;

is there a pragma (or other method) that will do the same thing
GUARANTEED not to change the field order to accomplish the packing
without having to write all these record representation clauses?



             reply	other threads:[~2004-11-18  0:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-18  0:20 Warren O. Merrill [this message]
2004-11-18  0:27 ` What is correct way to pack records Jeffrey Carter
2004-11-18  6:50 ` Martin Dowie
2004-11-18 12:37 ` Stephen Leake
2004-11-18 17:04 ` Marc A. Criley
2004-11-18 17:31   ` Jeffrey Carter
2004-11-18 18:00     ` Marc A. Criley
2004-11-19  3:08       ` Steve
2004-11-19 12:44         ` Frank J. Lhota
2004-11-19 13:28           ` Marc A. Criley
replies disabled

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