From: claveman@fern.mil (Charles H. Sampson)
Subject: Packing Records Using Size Attribute Definitions Clauses
Date: 1998/11/18
Date: 1998-11-18T00:00:00+00:00 [thread overview]
Message-ID: <1998Nov18.230626.16278@nosc.mil> (raw)
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".
next reply other threads:[~1998-11-18 0:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-11-18 0:00 Charles H. Sampson [this message]
1998-11-19 0:00 ` Packing Records Using Size Attribute Definitions Clauses Tucker Taft
1998-11-21 0:00 ` dewarr
1998-11-21 0:00 ` bob
1998-11-30 0:00 ` Charles H. Sampson
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox