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,233f0e04e488a4a2 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Size of 0..255 is not 8 bits? Date: 1998/05/14 Message-ID: #1/1 X-Deja-AN: 353354514 References: <355A436E.11F76529@cl.cam.ac.uk> X-Complaints-To: usenet@news.nyu.edu X-Trace: news.nyu.edu 895191338 2053 (None) 128.122.140.58 Organization: New York University Newsgroups: comp.lang.ada Date: 1998-05-14T00:00:00+00:00 List-Id: Matthew says <> More serious confusion on size! No, this is not "kind of confusing". It is perfectly reasonable, and very useful to write type x is range 0 .. 3; for x'size use 2; The size clause has nothing to do with the base values, which is where Matthew is getting confused. The above size clause works just fine in conjunction with pragma Pack, on an array, where you will get an array of 2 bit values as expected. The important thing to realize is that specifying a size for a type in Ada 95 does not necesarily affect the size of objects of that type except in the packed case. Howver, in a reasonable Ada 95 compiler, it is indeed the case that the size clause for Value above should result in objects of type Value being stored in 8 bits by default.