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-Thread: 103376,fd173879a595bde X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon06.news.prodigy.com!prodigy.net!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Default rep specs for record types - documented?? Date: 14 Nov 2005 13:49:46 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1131994186 20166 192.74.137.71 (14 Nov 2005 18:49:46 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Mon, 14 Nov 2005 18:49:46 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:6383 Date: 2005-11-14T13:49:46-05:00 List-Id: Anonymous Coward writes: > I'm shocked to hear that size specs on types are merely a *minimum*. Well, most compilers do something a little more sensible than what the RM minimally requires. But surely it makes no sense for the size of an object to always be the same as the type's size. Boolean'Size = 1, but you want to allocate Boolean variables in 32-bit registers, quite often. During the Ada 9X project, I used to say that 'Size is like one of those shower controls where you control the temperature and the amount of water with one knob. You can get a trickle of cold water, or a torrrent of hot water, but you can't get a trickle of hot water. You really want two knobs. That's pretty-much what GNAT did with 'Value_Size versus 'Object_Size. > Can I at least rely on pragma convention to guarantee an absolute size > on enums/integers? I believe that's the intent. > As for records, I've imposed sizes on all my rep spec'd record types. > It would normally be needless, but to protect the maintainer from > accidentally defining a partial rep spec as the operational spec > grows, I've added a size spec so an error will be thrown at compile > time. > > It seems your statement about size specs on types only being a minimum > does not apply to record types, correct? Jeff answered this. By "minumim", I meant that _if_ the compiler accepts the rep clause, it must allocate at least that many bits for objects. But "for T'Size use 0;" is still illegal for most types. - Bob