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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,78b2880bc7e78e39 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-17 01:38:53 PST Newsgroups: comp.lang.ada Path: nntp.stanford.edu!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!newsengine.sol.net!newspump.sol.net!nntp.msen.com!uunet!ash.uu.net!world!bobduff From: Robert A Duff Subject: Re: RISC Sender: bobduff@world.std.com (Robert A Duff) Message-ID: Date: Thu, 15 Mar 2001 14:49:34 GMT References: Organization: The World Public Access UNIX, Brookline, MA X-Newsreader: Gnus v5.3/Emacs 19.34 Xref: nntp.stanford.edu comp.lang.ada:91481 Date: 2001-03-15T14:49:34+00:00 List-Id: Ted Dennison writes: > In article , chris.danx > says... > > > >I'm curious about 'mod' types. If i define a type 'byte' like so > > > >* type byte is mod 256; > > > >will it occupy one byte of memory. > > It will if you also do the following: > > for byte'size use 8; > > If you don't do that, its completely up to the compiler. That's not quite right. 'Size clauses on *subtypes* don't necessarily do what you most people think (unfortunately). Byte'Size = 8 by default, and whether you say the above or not, it's a *minimum* size -- the compiler is free to allocate 32 bits for an object of type Byte. In fact, for a parameter, the object will most likely end up in a register. If you want to control the size of an object, put a 'Size clause on the object. Or if it's a record or array component, use a record_rep_clause or a Component_Size clause (resp). - Bob