comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: Using representation clauses in networking software
Date: Mon, 16 Aug 2010 06:57:46 -0400
Date: 2010-08-16T06:57:46-04:00	[thread overview]
Message-ID: <82eidyvn85.fsf@stephe-leake.org> (raw)
In-Reply-To: 43fkp7an4c5m$.3db3n6adym42.dlg@40tude.net

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:

> On Sun, 15 Aug 2010 15:44:34 +0200, Yannick Duchêne (Hibou57) wrote:
>
> (I agree with what you wrote. I am programming a lot of communication
> stuff, but never used representation clauses to handle endianness.)
>
>> I do not know neither any representation clause for Byte Ordering. 
>
> Byte ordering is what S'Bit_Ordering is, when bytes are addressable.

Not exactly.

> IMO, Bit_Ordering was an unfortunate choice. The attribute name suggests
> ordering of bits in some machine storage unit, which it is not.

Bit_ordering specifies how to interpret the bit numbers in Ada record
representation clauses.

The restriction of 'Bit_Order only being valid for the target endianness
was removed in Ada 2005.

It is useful for representing record layouts that may be used in
systems with different byte orders.

See http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ais/ai-00133.txt?rev=1.17
for a good discussion. The concept of 'machine scalars' is important.
Only part of this discussion made it into the ARM or AARM, so they are
hard to understand.

Still, S'Bit_ordering does _not_ solve the inter-machine byte endianness
problem. It could be part of a solution.

-- 
-- Stephe



  parent reply	other threads:[~2010-08-16 10:57 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-15 11:33 Using representation clauses in networking software Florian Weimer
2010-08-15 13:44 ` Yannick Duchêne (Hibou57)
2010-08-15 14:32   ` Dmitry A. Kazakov
2010-08-15 14:44     ` Florian Weimer
2010-08-15 15:04       ` Dmitry A. Kazakov
2010-08-15 15:32         ` Florian Weimer
2010-08-15 16:10           ` Dmitry A. Kazakov
2010-08-15 16:40             ` Yannick Duchêne (Hibou57)
2010-08-15 17:58               ` Dmitry A. Kazakov
2010-08-15 19:11                 ` Shark8
2010-08-15 19:15                 ` Simon Wright
2010-08-15 20:25                   ` Maciej Sobczak
2010-08-15 21:24                     ` Simon Wright
2010-08-16  6:40                     ` Dmitry A. Kazakov
2010-09-04 20:46                     ` Florian Weimer
2010-08-15 15:39         ` Yannick Duchêne (Hibou57)
2010-08-15 15:31       ` Yannick Duchêne (Hibou57)
2010-08-15 15:30     ` Yannick Duchêne (Hibou57)
2010-08-15 16:10       ` Dmitry A. Kazakov
2010-08-16 10:57     ` Stephen Leake [this message]
2010-08-15 15:58 ` Simon Wright
2010-08-15 16:03   ` Florian Weimer
2010-08-17  3:32     ` Randy Brukardt
2010-08-16  9:12 ` anon
replies disabled

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