24.05.2014 Views

AIX Version 4.3 Differences Guide

AIX Version 4.3 Differences Guide

AIX Version 4.3 Differences Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

These ANSI types are defined through the header . Note that the<br />

signed or unsigned are explicitly coded into the typedefs and not left to chance.<br />

Although it is unlikely that the defaults for short/int/long are unsigned, it is<br />

possible on some machines. Furthermore, by forcing the keyword, this would<br />

have the same error behavior in all cases if the user were to add a sign qualifier<br />

to the ANSI types, as in signed int8_t.<br />

3.3.1.3 Structure Alignment and Bitfields<br />

The LP64 specifications will change the size, member alignment, structure<br />

alignment, and bitfield sizes and alignment of most structures implicitly.<br />

Structures with only long and pointer types will at least double in size depending<br />

on the alignment mode.<br />

Sharing data between 64-bit and 32-bit processes will not be possible unless the<br />

fixed-width types are used, or the structure is devoid of pointer and long types.<br />

Special attention needs to be paid to unions that attempt to overlay int types with<br />

long types or pointer types.<br />

For the details of alignment in different modes and in combination with different<br />

compiler flags, consult the compiler reference manual.<br />

Table 15 provides the different alignments found in 32- or 64-bit modes.<br />

Table 15. Alignment of Basic Data Types in 32- and 64-Bit Mode<br />

Type 32-Bit 64-Bit<br />

char 1 1<br />

short 2 2<br />

int 4 4<br />

long 4 8<br />

long long 8 8<br />

float 4 4<br />

double 8 8<br />

pointer 4 8<br />

According to ANSI, a bit field will have a type that is a qualified or unqualified<br />

version of one of int, unsigned int, or signed int. Therefore, the ANSI mode<br />

cannot change the type.<br />

Bitfields in ANSI mode can only be signed int or unsigned int. In extended mode,<br />

common mode, or k&r mode, non-integer bitfields are tolerated. When a<br />

non-integer bitfield is tolerated, it means that any type other than int will be<br />

converted to int.<br />

The extended mode bitfields are updated to long types to admit 64-bit width in<br />

64-bit mode. If a long type bitfield of length greater than 32-bits is used in 32-bit<br />

extended mode, the following message is given:<br />

1506-003 (S) Width of a bit-field of type "long" cannot exceed 32.<br />

If a long type bitfield of length greater than 64-bits is used in 64-bit extended<br />

mode, the following message is given:<br />

60 <strong>AIX</strong> <strong>Version</strong> <strong>4.3</strong> <strong>Differences</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!