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,38ceb882eed41e1e,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-10 01:05:40 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: byhoe@greenlime.com (Adrian Hoe) Newsgroups: comp.lang.ada Subject: Size and pack Date: 10 Oct 2001 01:05:39 -0700 Organization: http://groups.google.com/ Message-ID: <9ff447f2.0110100005.2503bb00@posting.google.com> NNTP-Posting-Host: 210.186.173.191 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1002701140 460 127.0.0.1 (10 Oct 2001 08:05:40 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 10 Oct 2001 08:05:40 GMT Xref: archiver1.google.com comp.lang.ada:14120 Date: 2001-10-10T08:05:40+00:00 List-Id: Hello, I have the following declaration: type Rx_Header_Data is record Start_Byte : Character := Latin_1.STX; Splitter : Character; Command_Byte : Character; Pad_Byte_1 : Character; Pad_Byte_2 : Character; Log_Num : Interfaces.C.Long; End_Byte : Character := Latin_1.ETX; LRC : Character; end record; It supposed to be 11 bytes long but Rx_Header_Data'Size reports 14 bytes. 'Size will report 11 bytes when I add the following line: pragma pack (Rx_Header_Data); I have found that Log_Num : Interfaces.C.Long takes up 7 bytes without pragma pack. Why this happens? Can I use representation clause instead of pragma pack? If both methods work, which is the best approach and why? I use GNAT 3.13p on Linux. Thank you.