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 Dec 91 00:32:22 GMT From: sdd.hp.com!cs.utexas.edu!mars.tsd.arlut.utexas.edu!gardner@hplabs.hpl.hp. com (Donald Gardner) Subject: Re: 'SIZE attribute of a type Message-ID: <1991Dec7.003222.17204@titan.tsd.arlut.utexas.edu> List-Id: parkhill@email.sp.unisys.com (parkhill) writes: >As was stated in a previous posting by another author if a compiler >can pack an array of character such that each character only uses 7 >bits then Character'Size should return 7. >Image a compiler was smart enough to understand baised number ranges. > type b is range 9 .. 10; > or > type b is range 2**31 - 2 .. 2**31 - 1; >If the compiler can generate code that only uses 1 bit then b'Size >should return 1. Oh, that compilers were so cleverly written! Consider an application that is transferring data over a slow serial channel. If a compiler used the minimum number of bits needed to represent a type and the number of bits used was readily available (hopefully from the 'SIZE attribute), the task of maximizing communications throughput would be simplified. My original posting regarding the 'SIZE attribute of a type was motivated by such a need to determine the actual number of bits used to represent a type, rather than the number of bits used to store it.