Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Bit-fields can be used to allow flags or other integer values with small ranges to be packed together to save storage space. When used in structure members, bit fields can improve storage efficiency. Compilers will typically allocate consecutive bit-field structure members to the same int-sized dword, as long as they fit into that completely into that dword. However, the order of allocation within a word is different in different implementationsdword is implementation dependent. Some implementations are "right-to-left": the first member occupies the low-order position of the dword. Others are "left-to-right": the first member occupies the hhighhigh-order position of the dword. Depending of Calculations that depend on the order bits within a dword can lead to may produce different results on different calculations on different implementations.

...