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.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no 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-12 05:41:49 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!wn11feed!worldnet.att.net!207.217.77.102!newsfeed2.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!harp.news.atl.earthlink.net!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: Non byte-aligned components in GNAT rejected Date: Thu, 12 Dec 2002 08:41:15 -0500 Organization: MindSpring Enterprises Message-ID: References: <254c16a.0212111032.451cab61@posting.google.com> NNTP-Posting-Host: d1.56.bd.42 X-Server-Date: 12 Dec 2002 13:46:33 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Xref: archiver1.google.com comp.lang.ada:31738 Date: 2002-12-12T13:46:33+00:00 List-Id: If you figure out a way to do that without resorting to a raw binary, machine-dependent array that you pick apart manually, please drop me a line and let me know how you did that. I've had long standing problems with representation clauses on records that wouldn't let me do what I needed to do and the only answer has been to go do it some sort of butt-ugly way that looks more like C and makes everything dependent on hardware and the implementation. So much for record representation clauses being good for the embedded programmer. :-) MDC -- ====================================================================== Marin David Condic I work for: http://www.belcan.com/ My project is: http://www.jast.mil/ Send Replies To: m c o n d i c @ a c m . o r g "I'd trade it all for just a little more" -- Charles Montgomery Burns, [4F10] ====================================================================== Marc A. Criley wrote in message news:254c16a.0212111032.451cab61@posting.google.com... > (This is one of those situations where I wish I had the scratch to be an ACT > supported customer.) > > I'm in the midst of creating type definitions, both scalar and records, for > a thoroughly bit-oriented message set, i.e., absolutely NO regard is paid to > byte boundaries, other than the first and the last bytes of the messages. > > GNAT 3.14p on W2K is rejecting one of my rep specs, stating that "large > component must be on byte boundary". > > From a compiler implementor perspective, I can see where that limitation is > coming from, but this message format is extracted from a MIL-STD, and this > situation leads me to think that I may not be able to define a "natural" > record specification for messages defined in that standard. Are there any > other representation attributes I ought to try? I've tried 'Alignment and > gotten nowhere with that, so I'm open to suggestion (particularly if they > work on the cut-down package that's attached :-) > > If I can't find a way to put these definition together, I'll have to shift > to an "accessor" approach where I just stuff and retrieve bits from an > undifferentiated bit buffer. > > Marc A. Criley > > ----------------------------------------------------------- > > 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 Unit_Group_Type is record > B : Boolean; > Unit_Name : Unit_Name_Type; > end record; > for Unit_Group_Type use record > B at 0 range 0 .. 0; > Unit_Name at 0 range 1 .. 448; -- This is rejected > end record; > > end NBA;