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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,38ceb882eed41e1e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-11 03:12:36 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!bnewspeer01.bru.ops.eu.uu.net!bnewspost00.bru.ops.eu.uu.net!emea.uu.net!read.news.de.uu.net!not-for-mail Message-ID: <3BC57091.51ECCE8D@CCI.Sema.de> Date: Thu, 11 Oct 2001 12:12:33 +0200 From: Vincent Smeets Reply-To: VSmeets@slb.com Organization: SchlumbergerSema X-Mailer: Mozilla 4.77 [en] (X11; U; SunOS 5.6 sun4m) X-Accept-Language: nl, en, de MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Size and pack References: <9ff447f2.0110100005.2503bb00@posting.google.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: zerberus.cci.de X-Trace: 1002795154 read.news.de.uu.net 187 193.103.165.100 X-Complaints-To: abuse@de.uu.net Xref: archiver1.google.com comp.lang.ada:14234 Date: 2001-10-11T12:12:33+02:00 List-Id: Adrian Hoe wrote: > > 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. Just an other view and a question to CLA, If you read and write this record thrue a stream, will you then get the correct byte layout (with Log_Num at an odd byte)? -- Vincent Smeets SchlumbergerSema - Competence Center Informatik GmbH Lohberg 10 - 49716 Meppen - Germany tel: +49 5931-805-461 fax: +49 5931-805-175 mail: VSmeets@slb.com web: www.cci.de