From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 7 Sep 93 18:13:30 GMT From: psinntp!ocsystems!kdh@uunet.uu.net (Kevin D. Heatwole - OC Systems Inc.) Subject: obj'size for constants Message-ID: <1993Sep7.181330.3952@ocsystems.com> List-Id: Any of you Ada "language lawyers" out there have an opinion on this one: Consider: one : constant integer := 1; and integer'size = 32. What are legitimate values that an implementation may return for one'size? I have read AI-00536 and it seems fairly clear that "if X is an object of subtype S, then X'Size >= S'Size" so one'size should equal 32 (at least). But, the LRM states that p'size yields the number of bits allocated to hold the object. In our implementation, scalar constants are replicated at use and rarely have any bits allocated to them at runtime (in this case, one would most likely be represented in the hardware instruction (probably as part of the op-code), rather than allocated in data memory). In reading AI-00536, it doesn't seem that the authors considered this case (rather they were mainly concerned with "pad" bits). The reason I ask this question is that we are maintaining an Ada compiler which returns the actual number of bits reserved for the object in memory (e.g., one'size = 0), but a pesky user has filed a defect indicating that the result should be the same as type'size for constants (e.g., one'size = 32). We must fix all reported defects (if legitimate), but I would rather leave the current behaviour as it is. Thanks for any replies, Kevin D. Heatwole OC Systems, Inc. kdh@ocsystems.com