The bit pattern stored in the union member is accessed, and the value interpreted, according to the type of the member by which it is accessed.
Type |
Alignment Boundary |
Byte Alignment |
---|---|---|
char |
Byte |
1 |
short |
Halfword |
2 |
int |
Word |
4 |
long (SPARC) v8 |
Word |
4 |
long (SPARC) v9 |
Doubleword |
8 |
float (SPARC) |
Word |
4 |
double (SPARC) |
Doubleword (SPARC) Word (x86) |
8 (SPARC) 4 (x86) |
long double (SPARC) v8 |
Doubleword (SPARC) Word (x86) |
8 (SPARC) 4 (x86) |
long double (SPARC) v9 |
Quadword |
16 |
pointer (SPARC) v8 |
Word |
4 |
pointer (SPARC) v9 |
Quadword |
8 |
long long |
Doubleword (SPARC) Word (x86) |
8 (SPARC) 4 (x86) |
Structure members are padded internally, so that every element is aligned on the appropriate boundary.
Alignment of structures is the same as its more strictly aligned member. For example, a struct with only chars has no alignment restrictions, whereas a struct containing a double would be aligned on an 8-byte boundary.
It is treated as an unsigned int.
Bit-fields are allocated within a storage unit from high-order to low-order.
Bit-fields do not straddle storage-unit boundaries.
This is an int.