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,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-11 10:32:21 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: mcq95@earthlink.net (Marc A. Criley) Newsgroups: comp.lang.ada Subject: Non byte-aligned components in GNAT rejected Date: 11 Dec 2002 10:32:21 -0800 Organization: http://groups.google.com/ Message-ID: <254c16a.0212111032.451cab61@posting.google.com> NNTP-Posting-Host: 12.158.183.114 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1039631541 30515 127.0.0.1 (11 Dec 2002 18:32:21 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 11 Dec 2002 18:32:21 GMT Xref: archiver1.google.com comp.lang.ada:31698 Date: 2002-12-11T18:32:21+00:00 List-Id: (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;