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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,71dcb452eafb5045 X-Google-Attributes: gid103376,public From: Mats Weber Subject: Re: Ada enumerations Date: 1997/12/12 Message-ID: <34912441.6CE2FE35@elca-matrix.ch>#1/1 X-Deja-AN: 297529452 References: <348EDDC9.794B@hso.link.com> <34901D71.FD118790@elca-matrix.ch> Organization: ELCA Matrix SA Reply-To: Mats.Weber@elca-matrix.ch Newsgroups: comp.lang.ada Date: 1997-12-12T00:00:00+00:00 List-Id: Robert Dewar wrote: > > Mats Weber said > > < > X : Enum; > I : Integer; > > for I'Address use X'Address; > >> > > OUCH! I sure hope not, that would be a horrible approach for scalars, since > it would force them into memory. It is hard to believe any compiler is that > stupid, but you never know. I didn't mean to force the stuff into memory, I just meant "in effect" (I said "approximately like"). > In practice, all the compilers I have worked with do the sensible thing > when converting scalar types, i.e. zero or sign extend as appropriate, > and truncate at the most significant end if necessary. This is most > certainly what GNAT does. But only when the sizes are different, right ? For instance, if I convert a 32-bit integer to a 32-bit packed record of 4 bytes, I will get MSB first on a big endian machine and LSB first on a little endian machine ?