comp.lang.ada
 help / color / mirror / Atom feed
From: "David C. Hoos, Sr." <david.c.hoos.sr@ada95.com>
Subject: Re: Representation clause
Date: Sun, 25 Feb 2001 14:22:48 -0600
Date: 2001-02-25T14:22:48-06:00	[thread overview]
Message-ID: <CQdm6.136516$Ch.25230662@newsrump.sjc.telocity.net> (raw)
In-Reply-To: FOPl6.864$Vz2.141381754@newssvr16.news.prodigy.com

The fact that a given compiler may do reasonable things when the
sizes of the actual parameters of an instantiation of
Ada.Unchecked_Conversion are unequal, is not a property on
which I would like to depend.  However, since there is at least one
compiler for which my comment is not true, I have modified my
comment to read as follows:

   -- The enumeration's 'Size attribute must be the same as that of
   -- the representation type, else the effect is implementation-
   -- defined; in particular, the result can be abnormal (see
   -- RM95 13.9.1).

Now, of course, in the case of discontiguous representation, (the
case for the example code) the result can still be abnormal for the
Value function.  Accordingly, the package client may either test
the result with the 'Valid attribute, or opt to have an exception
raised.

"Ken Garlington" <Ken.Garlington@computer.org> wrote in message
news:FOPl6.864$Vz2.141381754@newssvr16.news.prodigy.com...
> "David C. Hoos, Sr." <david.c.hoos.sr@ada95.com> wrote in message
> news:fEOl6.129219$Ch.23956265@newsrump.sjc.telocity.net...
>
> :    -- The enumeration's 'Size attribute must be the same as that of
> :    -- the representation type, else a compile error will occur when
> :    -- instantiating the generic package.
> :    for Colors'Size use Integer'Size;
>
> By the way: on GNAT 3.13p, the following will generate a compiler
_warning_,
> but will compile:
>
>    for Colors'Size use 3;
>
> The  test program also ran successfully.
>
> You may wish to modify the comments appropriately.
>
>




  reply	other threads:[~2001-02-25 20:22 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-23  2:39 Representation clause Anatoly Chernyshev
2001-02-23  3:59 ` James Rogers
2001-02-23  8:46   ` Ada 0x: " Martin Dowie
2001-02-23  9:01     ` Lutz Donnerhacke
2001-02-23 10:22       ` David C. Hoos, Sr.
2001-02-23 13:56         ` Florian Weimer
2001-02-23 14:57           ` David C. Hoos, Sr.
2001-02-23 21:38             ` Florian Weimer
2001-02-23 21:12     ` Randy Brukardt
2001-02-24  5:44       ` James Rogers
2001-02-24 10:43         ` Florian Weimer
2001-02-24 17:47           ` James Rogers
2001-02-26 19:51             ` Randy Brukardt
2001-02-26 20:20               ` James Rogers
     [not found]                 ` <WURm6.3437$7e6.1392211@homer.alpha.net>
2001-02-28  2:32                   ` James Rogers
2001-02-23 13:25 ` Marc A. Criley
2001-02-23 14:08 ` Des Walker
2001-02-24 13:26 ` David C. Hoos, Sr.
2001-02-24 14:45   ` Ken Garlington
2001-02-25 20:22     ` David C. Hoos, Sr. [this message]
2001-02-26  0:53       ` Ken Garlington
replies disabled

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