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-Thread: 103376,7345e706c651a1a3 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Newsgroups: comp.lang.ada Subject: Re: pragma Pack does not work on GNAT 5.01a for Redhat Linux. From: Georg Bauhaus In-Reply-To: <1182259013.590515.118310@g4g2000hsf.googlegroups.com> References: <1182259013.590515.118310@g4g2000hsf.googlegroups.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1182261733.7759.26.camel@kartoffel> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Date: Tue, 19 Jun 2007 16:02:13 +0200 Organization: Arcor NNTP-Posting-Date: 19 Jun 2007 16:02:11 CEST NNTP-Posting-Host: 9aa0887e.newsspool4.arcor-online.net X-Trace: DXC=`XjJl8Wd_;dPXlQ;h]GTMd4IUK On Tue, 2007-06-19 at 06:16 -0700, petter_fryklund@hotmail.com wrote: > The Size of the following record is 112 on Linux, but 104 on Solaris. > > type Something is record > A : Packed_16; > B : Packed_8; > C : Packed_8; > D : Packed_8; > E : Packed_32; > F : Packed_32; > end record; > pragma Pack (Something); ... > and similar. Why is pragma Pack ignored? I don't think pragma Pack is ignored, there are "should"s in the RM and then alignment. You might need a rep spec, though. Does this work? -- assume word size of 32 bits, 4 bytes wordsize: constant := 4; for Something use record A at 0*wordsize range 0 .. 15; B at 0*wordsize range 16 .. 23; C at 0*wordsize range 24 .. 31; D at 3*wordsize range 0 .. 7; E at 1*wordsize range 0 .. 31; F at 2*wordsize range 0 .. 31; end record; for Something'Size use 104;