HPlogo HP C/HP-UX Reference Manual: Version A.05.55.02 > Chapter 10 HP C/HP-UX Implementation Topics

Bit-Fields

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

  • Bit-fields in structures are packed from left to right (high-order to low-order).

  • The high order bit position of a “plain” integer bit-field is treated as a sign bit.

  • Bit-fields of types char, short, long, long long, and enum are allowed.

  • The maximum size of a bit-field is 64 bits.

  • If a bit-field is too large to fit in the current word, it is moved to the next word.

  • The range of values in an integer bit-field are:

    -2,147,483,648 to 2,147,483,647 for 32-bit signed quantities

    0 to 4,294,967,295 for 32-bit unsigned quantities

    -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 for 64-bit signed quantities

    0 to 18,446,744,073,709,551,615 for 64-bit unsigned quantities

  • Bit-fields in unions are allowed only in ANSI mode.

© Hewlett-Packard Development Company, L.P.