comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Enumeration representation clause surprise.
Date: Fri, 13 Jun 2008 09:21:02 -0700 (PDT)
Date: 2008-06-13T09:21:02-07:00	[thread overview]
Message-ID: <4f5f512a-36e6-466e-a5a9-5f26857841f8@w4g2000prd.googlegroups.com> (raw)
In-Reply-To: aedf484a-83cf-4047-8651-d91fd89adbce@y21g2000hsf.googlegroups.com

On Jun 13, 1:27 am, christoph.gr...@eurocopter.com wrote:
> > > With the proposed patch, it gives:
>
> > > GNAT 4.4.0 20080611 (experimental)
> > >     26.         X1 at 0 range 0 .. -1;                   -- Minus 1 !!
> > >                    |
> > >         >>> warning: component representation will be biased
>
> > So what would the value of the bias be?
>
>   type X_Type is ( X );
>   for x_type use (x => 16#7FFF_FFFF#);
>
> 16#7FFF_FFFF# of course
>
> Since this is the only value, nothing need be stored to know which
> value it is. This is like a constant in ROM, I gather.

My point is that the "bias" is the difference between the (conceptual)
value being represented, and the number actually stored in memory.  So
what number is stored in a 0-bit data item?  I suppose you could
arbitrarily decide it's zero (which would make some sense
mathematically) but it seems more commonsensical to say that nothing
is stored there because there ain't no bits to store anything in.

                              -- Adam





  reply	other threads:[~2008-06-13 16:21 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-11 11:38 Enumeration representation clause surprise Markus Schoepflin
2008-06-11 12:30 ` christoph.grein
2008-06-11 12:56   ` Markus Schoepflin
2008-06-11 13:08     ` christoph.grein
2008-06-11 13:28     ` Samuel Tardieu
2008-06-11 13:48       ` Markus Schoepflin
2008-06-11 13:56         ` Samuel Tardieu
2008-06-11 14:58       ` Adam Beneschan
2008-06-11 15:23         ` Markus Schoepflin
2008-06-12  2:37           ` Randy Brukardt
2008-06-12  2:37           ` Randy Brukardt
2008-06-11 15:56         ` Samuel Tardieu
2008-06-11 19:10           ` Adam Beneschan
2008-06-11 19:59             ` Niklas Holsti
2008-06-12  1:16               ` tmoran
2008-06-12  8:27                 ` christoph.grein
2008-06-12  8:45               ` Markus Schoepflin
2008-06-12 16:43                 ` Mike Silva
2008-06-12 18:41                   ` Markus Schöpflin
2008-06-12 20:10                     ` Mike Silva
2008-06-12 20:52                       ` Simon Wright
2008-06-12 23:36                         ` Mike Silva
2008-06-13  5:49                           ` Simon Wright
2008-06-13  7:21                       ` Keith Thompson
2008-06-13 13:31                         ` Mike Silva
2008-06-13 14:45                           ` Markus Schoepflin
2008-06-13 17:52                           ` Keith Thompson
2008-06-13  9:14                       ` Jean-Pierre Rosen
2008-06-12 19:05 ` richtmyer
2008-06-12 21:26   ` Samuel Tardieu
2008-06-12 22:42     ` Adam Beneschan
2008-06-13  7:11       ` Samuel Tardieu
2008-06-13  8:27       ` christoph.grein
2008-06-13 16:21         ` Adam Beneschan [this message]
2008-06-15 19:33           ` Robert A Duff
2008-06-16 14:50             ` Adam Beneschan
2008-06-16 19:18               ` Robert A Duff
2008-06-17  6:03               ` christoph.grein
2008-06-17  7:22                 ` christoph.grein
2008-06-13  8:24     ` Peter Hermann
2008-06-13 14:47       ` Samuel Tardieu
2008-06-14 11:48         ` John B. Matthews
replies disabled

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