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, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4b89102f705d4611 X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: The Incredible Shrinking Type Date: 2000/11/07 Message-ID: <8ua3d6$bn0$1@nnrp1.deja.com>#1/1 X-Deja-AN: 690993290 References: <3A0703F5.9333AE56@earthlink.net> <8u7gte$7ie$1@nnrp1.deja.com> <3A08092F.E369B323@earthlink.net> X-Http-Proxy: 1.0 x73.deja.com:80 (Squid/1.1.22) for client 166.72.71.31 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Tue Nov 07 23:31:49 2000 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; I) Date: 2000-11-07T00:00:00+00:00 List-Id: In article <3A08092F.E369B323@earthlink.net>, "Marc A. Criley" wrote: > However, today, the last of the residual reluctance has > finally been cleared away...and I do believe! :-) The real actuality is that compilers will generally let type'size influence object'size where it makes reasonable sense. Certainly we don't expect compilers to try to allocate 5-bit objects (though amazingly the old Alsys compilers did just that). On the other hand if we say one type is 8 bits and one type is 16 bits, and we are on a byte addressed machine, it would be most surprising if we did not get 8 bits and 16 bits for objects respectively (GNAT allows you to force this with Object_Size if necessary). However, for strange things like this type with padding, bets are off. Generally the notion in GNAT is that a parameter size corresponds to the size of the value not the size of the allocated object, that for example makes a very big difference with variant records, and most programs assume that you get the size of the particular variant represented by the parameter, rather than the allocated size of the object, which can of course be larger. The RM has little to say here in this rather significant choice, we just go by what Ada 83 compilers seem to do in practice. Note that you should never assume too much about the size of parameters, since the compiler is free to choose, and there is no way to override it in Ada 95 for parameters. > > > > > So the real issue here is what you have read in the RM that > > implies that the above behavior is expected or not expected. > > Actually asking for more than 64 bits for a scalar type is > > a bit peculiar anyway (and way out of the portable behavior > > required by the RM). > > > > I agree this is a peculiar use. Fortunately I'm not employing that > technique, I just want to be able to properly and accurately analyze any > such peculiar software that I may come across. > > Marc A. Criley > Senior Staff Engineer > Quadrus Corporation > Sent via Deja.com http://www.deja.com/ Before you buy.