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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9ed448b3da4e578c X-Google-Attributes: gid103376,public From: Samuel Tardieu Subject: Re: Interfacing Ada to C Date: 1997/05/29 Message-ID: #1/1 X-Deja-AN: 244738364 Sender: sam@zaphod.enst.fr References: <5mjvk9$sm7$1@luna.ffi.no> To: ruw@ffi.no (Rune Wemberg) Organization: Sam's machine Newsgroups: comp.lang.ada Date: 1997-05-29T00:00:00+00:00 List-Id: >>>>> "Rune" == Rune Wemberg writes: Rune> Does anyone know what a packed Ada record is? It's a record on which you apply a pragma Pack. For example, the following type R is a packed record: type My_Natural is range 0 .. 15; for My_Natural'Size use 4; type R is record A, B : My_Natural; end record; pragma Pack (R); for R'Size use 8; If you do: My_R : aliased constant R := (1, 2); then My_R will be represented in memory by a single byte containing 00010010 (or 00100001, depending on the endianness). Here is the code generated by GNAT for the m68k: .data _t__my_r: .byte 0x12 Hope this helps. Sam -- Samuel Tardieu -- sam@ada.eu.org