comp.lang.ada
 help / color / mirror / Atom feed
From: "Stanley R. Allen" <s_allen@hso.link.com>
Subject: Re: Ada Enumerations
Date: 1997/12/04
Date: 1997-12-04T00:00:00+00:00	[thread overview]
Message-ID: <34873053.15FB@hso.link.com> (raw)
In-Reply-To: dewar.881244174@merv


Robert Dewar wrote:
> 
> I must say I don't see so much of a problem with Unchecked_Conversion for
> replacing Enum_Rep unless you have a really hostile compiler. For types
> like this, Unchecked_Conversion should work as expected in cases where
> the number of bits of the source and target differs.

At least you *hope* so; too bad for you if your application
depends on it and the compiler doesn't do it right, or if
you need to port to a "hostile" compiler.  There being no
rule for this in either Ada83 or Ada95 (and apparently no
"implementation advice" to this effect in the new standard),
it is perfectly permissible for compilers to implement
unchecked_conversion in such a way that garbage is there if
the sizes are mismatched, which is one of the potential uses
of the new 'Valid attribute.  There is no clean way to recover
from this situation, either.  Especially when porting, these
are the anomalies that try men's souls.

See my other post for other reasons to dislike UC for this.

-- 
Stanley Allen
mailto:s_allen@hso.link.com




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

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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       ` 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       ` GNAT'Object_Size Mats Weber
1997-12-05  0:00         ` GNAT'Object_Size Mats Weber
1997-12-04  0:00       ` GNAT'Object_Size Mats Weber
1997-12-04  0:00       ` GNAT'Object_Size Mats Weber
1997-12-08  0:00         ` GNAT'Object_Size Mats Weber
1997-12-10  0:00           ` GNAT'Object_Size Robert Dewar
1997-12-04  0:00       ` GNAT'Object_Size Mats Weber
1997-12-04  0:00       ` Ada Enumerations Robert Dewar
1997-12-04  0:00         ` Stanley R. Allen [this message]
1997-12-18  0:00           ` Wes Groleau
1997-12-04  0:00       ` GNAT'Object_Size Mats Weber
1997-12-04  0:00 ` Ada Enumerations Stephen Leake
1997-12-04  0:00   ` Matthew Heaney
1997-12-04  0:00     ` Robert Dewar
1997-12-06  0:00       ` Jean-Pierre Rosen
1997-12-06  0:00         ` Making Predefined Operators Abstract Matthew Heaney
  -- strict thread matches above, loose matches on Subject: below --
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
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
replies disabled

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