Next: , Previous: Component_Size Clauses, Up: Representation Clauses and Pragmas


8.8 Bit_Order Clauses

For record subtypes, GNAT permits the specification of the Bit_Order attribute. The specification may either correspond to the default bit order for the target, in which case the specification has no effect and places no additional restrictions, or it may be for the non-standard setting (that is the opposite of the default).

In the case where the non-standard value is specified, the effect is to renumber bits within each byte, but the ordering of bytes is not affected. There are certain restrictions placed on component clauses as follows:

Since the misconception that Bit_Order automatically deals with all endian-related incompatibilities is a common one, the specification of a component field that is an integral number of bytes will always generate a warning. This warning may be suppressed using pragma Warnings (Off) if desired. The following section contains additional details regarding the issue of byte ordering.