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,MSGID_SHORT autolearn=no autolearn_force=no version=3.4.5-pre1 Date: 12 Dec 91 15:36:34 GMT From: elroy.jpl.nasa.gov!sdd.hp.com!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu !dsinc!gvlf3.gvl.unisys.com!email!parkhill@ames.arc.nasa.gov (parkhill) Subject: Re: 'SIZE attribute of a type Message-ID: <5901@email.sp.unisys.com> List-Id: Mr Mark Biggar writes: >I don't thing anyone would implement this as an automatic feature of an >Ada compiler. But, it is perfectly reasonable for the rep-clause > for b'size use 1; > to cause a compiler to do just what you want, while not having the > rep-clause would make b'size something like 8, 16 or 32. > b'size is the actual storage used for the type not the minimum possible. If I am correctly understanding the interpretation of Type_Name'Size the attribute should return the minimum number of bits objects of this type might require. So when a compiler usually uses 16 bits to represent objects of type boolean, but in the case of pragma pack on a boolean array only uses 1 bit, Boolean'Size must return 1. In the case of of compiler that can at some time understand and interpret baised types and produce a very small range, than the compiler should generate and return that small number of bits for type_name'Size. Remember, even if you do not use pragma Pack in your program Boolean'Size still returns 1. It doesn't matter if you use the feature at all, it only depends upon whether the compiler is capable of packing boolean arrays. I believe Object_Name'Size returns the actual storage used for an object. There is little correlation between Object_Name'Size and Type_Name'Size. If I am wrong anyone feel free to post a correction. I am clearly NOT an Ada expert. Robert Parkhill