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!news3.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: ADA compilers can reject types arbitrarily? Date: 14 Nov 2005 22:12:59 -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 1132024380 5600 192.74.137.71 (15 Nov 2005 03:13:00 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Tue, 15 Nov 2005 03:13:00 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:6389 Date: 2005-11-14T22:12:59-05:00 List-Id: Anonymous Coward writes: > In article , > Robert A Duff wrote: > > > > 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. > > Ah, yes.. I had forgotten that a types size is the same as the value > size, since I was dealing with records. It didn't occur to me that > record type size specs should really be treated the same as they would > be w/ integers; so that makes sense. Well, records can be small, too. E.g a packed record containing three booleans could have 'Size = 3, but you want to allocate objects in a 32-bit register. >...Considering type sizes are > really value sizes, it's more clear to me now why T'size would only > specify a minimum. I assume I can expect an O'size spec to be > absolute (O being an object). Yes. > No way! So an ADA compiler can arbitrarily decide whether to accept a > rep spec? No, there are all kinds of rules and regulations about what a compiler has to support, and what it is allowed to support. See section C.2, which applies if the SP annex is supported. I think you can safely count on SP annex support in all Ada compilers of interest. My example was T'Size = 0 -- there aren't many types that fit in 0 bits. - Bob