Talk About Network

Google





Programming > Ada > Re: Enumeration...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 42 Topic 5748 of 6006
Post > Topic >>

Re: Enumeration representation clause surprise.

by Markus Schoepflin <nospam@[EMAIL PROTECTED] > Jun 11, 2008 at 02:56 PM

christoph.grein@[EMAIL PROTECTED]
 wrote:

> What you request for A1 seems impossible: Store value 2 = 2#01# in one
> bit.

This is exactly my point. I would have expected a compile time error for 
this impossible request.

Representation clauses are (amongst other) meant to specify specific
binary 
layouts for interfacing with the external world. Or am I mistaken here?

> An illustrating example:
> 
> type My_Int is range 10_000 .. 10_001;
> 
> type My_Record is record
>   I: My_Int;
> end record;
> 
> for My_Record use record
>   I at 0 range 0 .. 0;
> end record;
> 
> This is allowed. My_Record holds only two values, so one bit is
> enough. The compiler uses a so-called biased representation with
> 10_000 as bias, which need not be stored.

Yes, I am aware that this feature exists, I am just unhappy that it is
also 
allowed for enumerations.

Is there another Ada mechanism for specifying external interfaces like
this 
one? One that does not have the same subtle maintenance trap?

> Hope this helps.

Thanks,
Markus
 




 42 Posts in Topic:
Enumeration representation clause surprise.
Markus Schoepflin <nos  2008-06-11 13:38:17 
Re: Enumeration representation clause surprise.
christoph.grein@[EMAIL PR  2008-06-11 05:30:35 
Re: Enumeration representation clause surprise.
Markus Schoepflin <nos  2008-06-11 14:56:34 
Re: Enumeration representation clause surprise.
Samuel Tardieu <sam@[E  2008-06-11 15:28:36 
Re: Enumeration representation clause surprise.
Markus Schoepflin <nos  2008-06-11 15:48:09 
Re: Enumeration representation clause surprise.
Samuel Tardieu <sam@[E  2008-06-11 15:56:28 
Re: Enumeration representation clause surprise.
christoph.grein@[EMAIL PR  2008-06-11 06:08:06 
Re: Enumeration representation clause surprise.
Adam Beneschan <adam@[  2008-06-11 07:58:44 
Re: Enumeration representation clause surprise.
Markus Schoepflin <nos  2008-06-11 17:23:25 
Re: Enumeration representation clause surprise.
"Randy Brukardt"  2008-06-11 21:37:06 
Re: Enumeration representation clause surprise.
"Randy Brukardt"  2008-06-11 21:37:06 
Re: Enumeration representation clause surprise.
Samuel Tardieu <sam@[E  2008-06-11 17:56:12 
Re: Enumeration representation clause surprise.
Adam Beneschan <adam@[  2008-06-11 12:10:33 
Re: Enumeration representation clause surprise.
Niklas Holsti <niklas.  2008-06-11 22:59:12 
Re: Enumeration representation clause surprise.
tmoran@[EMAIL PROTECTED]   2008-06-11 20:16:54 
Re: Enumeration representation clause surprise.
christoph.grein@[EMAIL PR  2008-06-12 01:27:45 
Re: Enumeration representation clause surprise.
Markus Schoepflin <nos  2008-06-12 10:45:14 
Re: Enumeration representation clause surprise.
Mike Silva <snarflemik  2008-06-12 09:43:45 
Re: Enumeration representation clause surprise.
=?ISO-8859-1?Q?Markus_Sch  2008-06-12 20:41:37 
Re: Enumeration representation clause surprise.
Mike Silva <snarflemik  2008-06-12 13:10:49 
Re: Enumeration representation clause surprise.
Simon Wright <simon.j.  2008-06-12 21:52:56 
Re: Enumeration representation clause surprise.
Keith Thompson <kst-u@  2008-06-13 00:21:08 
Re: Enumeration representation clause surprise.
Jean-Pierre Rosen <ros  2008-06-13 11:14:09 
Re: Enumeration representation clause surprise.
Mike Silva <snarflemik  2008-06-12 16:36:19 
Re: Enumeration representation clause surprise.
Simon Wright <simon.j.  2008-06-13 06:49:09 
Re: Enumeration representation clause surprise.
Mike Silva <snarflemik  2008-06-13 06:31:41 
Re: Enumeration representation clause surprise.
Markus Schoepflin <nos  2008-06-13 16:45:09 
Re: Enumeration representation clause surprise.
Keith Thompson <kst-u@  2008-06-13 10:52:43 
Re: Enumeration representation clause surprise.
richtmyer@[EMAIL PROTECTE  2008-06-12 12:05:05 
Re: Enumeration representation clause surprise.
Samuel Tardieu <sam@[E  2008-06-12 23:26:55 
Re: Enumeration representation clause surprise.
Peter Hermann <ica2ph@  2008-06-13 08:24:25 
Re: Enumeration representation clause surprise.
Samuel Tardieu <sam@[E  2008-06-13 16:47:45 
Re: Enumeration representation clause surprise.
"John B. Matthews&qu  2008-06-14 07:48:33 
Re: Enumeration representation clause surprise.
Adam Beneschan <adam@[  2008-06-12 15:42:29 
Re: Enumeration representation clause surprise.
Samuel Tardieu <sam@[E  2008-06-13 09:11:17 
Re: Enumeration representation clause surprise.
christoph.grein@[EMAIL PR  2008-06-13 01:27:07 
Re: Enumeration representation clause surprise.
Adam Beneschan <adam@[  2008-06-13 09:21:02 
Re: Enumeration representation clause surprise.
Robert A Duff <bobduff  2008-06-15 15:33:03 
Re: Enumeration representation clause surprise.
Adam Beneschan <adam@[  2008-06-16 07:50:19 
Re: Enumeration representation clause surprise.
Robert A Duff <bobduff  2008-06-16 15:18:23 
Re: Enumeration representation clause surprise.
christoph.grein@[EMAIL PR  2008-06-16 23:03:18 
Re: Enumeration representation clause surprise.
christoph.grein@[EMAIL PR  2008-06-17 00:22:33 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Wed Jan 7 14:25:15 PST 2009.