comp.lang.ada
 help / color / mirror / Atom feed
From: Mats Weber <Mats.Weber@elca-matrix.ch>
Subject: Re: Ada enumerations
Date: 1997/12/12
Date: 1997-12-12T00:00:00+00:00	[thread overview]
Message-ID: <34912441.6CE2FE35@elca-matrix.ch> (raw)
In-Reply-To: dewar.881883499@merv


Robert Dewar wrote:
> 
> Mats Weber said
> 
> <<Isn't Unchecked_Conversion approximately like doing
> 
>    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 ?




  reply	other threads:[~1997-12-12  0:00 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-12-10  0:00 Ada enumerations Stanley R. Allen
1997-12-10  0:00 ` John M. Mills
1997-12-10  0:00 ` Robert Dewar
1997-12-11  0:00   ` Mats Weber
1997-12-11  0:00     ` Robert Dewar
1997-12-12  0:00       ` Mats Weber [this message]
1997-12-12  0:00         ` Robert Dewar
1997-12-12  0:00     ` Samuel T. Harris
1997-12-11  0:00   ` Stanley R. Allen
1997-12-12  0:00     ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1997-12-03  0:00 Ada Enumerations Jeffrey Harris
1997-12-03  0:00 ` James S. Rogers
1997-12-03  0:00   ` Robert Dewar
1997-12-03  0:00     ` Stanley R. Allen
1997-12-04  0:00       ` Robert Dewar
1997-12-04  0:00         ` Stanley R. Allen
1997-12-18  0:00           ` Wes Groleau
1997-12-04  0:00       ` Matthew Heaney
1997-12-04  0:00         ` Stanley R. Allen
1997-12-07  0:00           ` Keith Thompson
1997-12-07  0:00             ` Matthew Heaney
1997-12-07  0:00             ` Robert Dewar
1997-12-08  0:00               ` Keith Thompson
1997-12-07  0:00                 ` Matthew Heaney
1997-12-11  0:00                   ` John G. Volan
1997-12-04  0:00 ` Stephen Leake
1997-12-04  0:00   ` Matthew Heaney
1997-12-04  0:00     ` Robert Dewar
1997-12-06  0:00       ` Jean-Pierre Rosen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox