comp.lang.ada
 help / color / mirror / Atom feed
* What is correct way to pack records
@ 2004-11-18  0:20 Warren O. Merrill
  2004-11-18  0:27 ` Jeffrey Carter
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Warren O. Merrill @ 2004-11-18  0:20 UTC (permalink / 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?



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-11-19 13:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-18  0:20 What is correct way to pack records Warren O. Merrill
2004-11-18  0:27 ` 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

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