C/C++ Programmer's Guide (G06.25+)
Compiler Pragmas
HP C/C++ Programmer’s Guide for NonStop Systems—429301-008
13-30
FIELDALIGN
align-attribute
specifies the alignment rules for the compiler to follow. Valid values are:
AUTO
directs the compiler to choose the layout scheme. The compiler might add
implicit (anonymous) fillers to ensure that components are properly aligned.
This is the default alignment. The TNS C compiler and the native C and C++
compilers have different AUTO alignment rules.
CSHARED2
directs the TNS C, native C, and native C++ compilers to lay out components
using the TNS C compiler AUTO alignment rules. Substructures and derived
classes with AUTO alignment and pointers with platform-dependent sizes are
not allowed when CSHARED2 is specified.
SHARED2
directs the TNS C, native C, and native C++ compilers to lay out components
using the default TAL compiler alignment rules. Additionally, 64-bit unsigned
values are allowed in a structure, class, or union that has been qualified with
FIELDALIGN SHARED2.
SHARED8
directs the TNS C, native C, and native C++ compilers to lay out components
using the pTAL compiler SHARED8 alignment rules. Additionally, 64-bit
unsigned values are allowed in a structure, class, or union that has been
qualified with FIELDALIGN SHARED8.
PLATFORM
directs the TNS C compiler to lay out components using the SHARED2
alignment rules, and directs the native C and C++ compilers to lay out
components using the AUTO alignment rules.
tag-name
specifies the name of a structure to which the given alignment rules apply. If no tag
is specified, the FIELDALIGN pragma applies the structure allocation scheme to
all structures in the compilation unit.
The pragma default settings are:
SYSTYPE GUARDIAN SYSTYPE OSS
TNS C compiler FIELDALIGN AUTO FIELDALIGN AUTO
G-series TNS c89 utility FIELDALIGN AUTO FIELDALIGN AUTO