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,d842554064cfae31 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-13 04:41:01 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!snoopy.risq.qc.ca!newsfeed.news2me.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3DF9D537.1DB616B7@earthlink.net> From: "Marc A. Criley" Organization: Quadrus Corporation X-Mailer: Mozilla 4.73 [en] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Non byte-aligned components in GNAT rejected References: <254c16a.0212111032.451cab61@posting.google.com> <1b585154.0212121025.5956cad1@posting.google.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 13 Dec 2002 12:39:51 GMT NNTP-Posting-Host: 63.190.233.42 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 1039783191 63.190.233.42 (Fri, 13 Dec 2002 04:39:51 PST) NNTP-Posting-Date: Fri, 13 Dec 2002 04:39:51 PST Xref: archiver1.google.com comp.lang.ada:31782 Date: 2002-12-13T12:39:51+00:00 List-Id: Peter Richtmyer wrote: > > Using Gnat 3.15p I had the same error you did. > I found a work-around that might be acceptable to you: > > package NBA is > > type VMF_Character is new Character range > Character'Val(0) .. Character'Val(127); > for VMF_Character'Size use 7; > > type Unit_Name_Type is array (1..64) of VMF_Character; > for Unit_Name_Type'Component_Size use 7; > for Unit_Name_Type'Size use 448; > > type un_t is -- new > record -- new > un : Unit_Name_Type; -- new > end record; -- new > -- for un_t'size use 448; -- bad results! > > type Unit_Group_Type is record > B : Boolean; > -- Unit_Name : Unit_Name_Type; -- deleted > Unit_Name : un_t; -- new > end record; > for Unit_Group_Type use record > B at 0 range 0 .. 0; > Unit_Name at 0 range 1 .. 448; -- This is OK now > end record; > > end NBA; > > As you can see, the Unit_Name is still one variable, > using th same type definition, but is now a record > within the record. I compiled this with GNAT 3.15p on Win2K and 3.13p on Linux and still got an error, albeit a different one: "nba.ads:21:07: fields of "un_t" must start at storage unit boundary". Line 21 is the "Unit_Name : un_t;" line. What GNAT/OS did you use? Marc