The following command compiles prog.C to assembly code rather than to object code, and puts the assembly code in the file prog.s.

aCC -S prog.C

Data Alignment and Storage

This section describes default data storage allocation and alignment for HP compiler data types.

Data storage refers to the size of data types, such as bool, short, int, float, and char*. Data alignment refers to the way the HP compiler aligns data structures in memory. Data type alignment and storage differences can cause problems when moving data between systems that have different alignment and storage schemes. These differences become apparent when a structure is exchanged between systems using files or inter-process communication. In addition, misaligned data addresses can cause bus errors when an attempt is made to dereference the address.

For information on unaligned data access, See “Handling Unaligned Data” (page 101).

Table 3 lists the size and alignment of the HP compiler data types:

Table 3 Size and Alignment of HP Compiler Data Types

Data Type

Size (in bytes)

Alignment

 

 

 

bool

1

1-byte

 

 

 

char, unsigned char, signed

1

1

char

 

 

 

 

 

wchar_t

4

4

 

 

 

short, unsigned short, signed

2

2

short

 

 

 

 

 

int, unsigned int

4

4

 

 

 

long, unsigned long

4*

4*

 

 

 

float

4

4

 

 

 

__float80

16

16

 

 

 

__float128

16

8**

 

 

 

_Decimal32

4

4

 

 

 

_Decimal64

8

8

 

 

 

_Decimal128

16

16

 

 

 

double

8

8

 

 

 

long double

16

8**

 

 

 

long long, unsigned long long

8

8

 

 

 

enum

4

4

 

 

 

arrays

Size of array element type

Alignment of array element type

 

 

 

struct

***

1-, 2-, 4-, 8-, or 16-byte

 

 

 

union

***

1-, 2-, 4-, 8-, or 16-byte

 

 

 

bit-fields

Size of declared type

Alignment of declared type

 

 

 

pointer

4*

4*

 

 

 

*In 64-bit mode, long, unsigned long, and pointer data types are 8 bytes long and 8-byte aligned. ** In 64-bit mode, long double is 16-byte aligned.

34 Command-Line Options