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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,be97e82d84e1ded9,start X-Google-Attributes: gid103376,public From: claveman@fern.mil (Charles H. Sampson) Subject: Packing Records Using Size Attribute Definitions Clauses Date: 1998/11/18 Message-ID: <1998Nov18.230626.16278@nosc.mil>#1/1 X-Deja-AN: 413336603 Sender: news@nosc.mil Organization: Computer Sciences Corporation Newsgroups: comp.lang.ada Date: 1998-11-18T00:00:00+00:00 List-Id: Did something happen between Ada 83 and Ada 95 affecting the abil- ity to pack a record by using a Size attribute definition clause? This is not one of the advertised incompatibilities, but I've tried my code on three Ada 95 compilers and they all reject it. Here are the details. The components of the record are numeric (integer and fixed-point), with one exception. The types of the numeric components have size attribute clauses specifying either 16 bits or 32 bits, with two exceptions. The two exceptional numeric component types have size attribute clauses specifying 7 and 9 bits and the correspond- ing components are consecutive in the source. The non-numeric component is of a record type and this type has a representation specification and a size attribute clause that specifies it as 16 bits. The minimum size for the big record type (the one I'm having a problem with) is 464 bits. It has a size attribute clause for this size. Everything sails through our Ada 83 compiler. GNAT, ObjectAda, and Green Hills are all unhappy with this, claim- ing that 464 bits is not enough, although they don't agree on how many bits are needed. However, when I throw in a record representation specification that maps the components in the obvious fashion (leaving in the size attribute clause), all three compilers are happy. Maybe I'm being naive, but if the representation is legal shouldn't at least one of the compilers have found it on its own? At the very least, why should they be telling me that 464 bits are not enough when all you have to do is add up the lengths of the components? But I don't want this post to be a compiler gripe. Would somebody please point me to the part of the LRM that explains this behavior. If the issue has already been discussed to death, then a pointer to the thread on Deja News would be fine. (I've already searched c.l.a using (size & (attribute | specification | spec)) and haven't found anything.) Charlie -- ****** For an email response, my user name is "sampson" and my host is "spawar.navy.mil".