C/C++ Programmer's Guide (G06.27+, H06.03+)

Table Of Contents
HP C Implementation-Defined Behavior
HP C/C++ Programmer’s Guide for NonStop Systems429301-010
A-19
G.3.7 Arrays and Pointers
When an integral number is converted to a floating-point number that cannot exactly
represent the original value, the direction of truncation is up.
When a floating-point number is converted to a narrower floating-point number, the
direction of truncation, or rounding is up.
G.3.7 Arrays and Pointers
An unsigned long integer is required to hold the maximum size of an array, that is
the type of the size of operator size_t.
32 bits is the size of the integer required for a pointer to be converted to an integral
type.
Casting a pointer to an integer returns: "Warning 32: invalid conversion specified."
Casting an integer to a pointer works without error or warning.
An integer of type long is required to hold the difference between two pointers to
members of the same array, ptrdiff_t.
G.3.8 Registers
The register storage class specifier has no effect on the actual storage of objects in
registers.
G.3.9 Structures, Unions, Enumerations and Bit Fields
If a member of a union object is accessed using a member of a different type, the
member is automatically cast to the type of the destination, as long as the conversion
is valid. In other words, it works the same as conversions between variables that are
not union members.
For the padding and alignment of members of structures, all fields are aligned on 16-bit
boundaries, except characters that are aligned on byte boundaries.
The equivalent type for a plain int bit field is:
signed int bit field
unsigned int bit field
The order of allocation of bit fields within an int is high order to low order.
A bit field cannot straddle a storage-unit boundary.
The int integer type has been chosen to represent the values of an enumeration type.
G.3.10 Qualifiers
An access through an lvalue is needed to access a volatile-qualified type object.