C/C++ Programmer's Guide (G06.25+)
Compiler Pragmas
HP C/C++ Programmer’s Guide for NonStop Systems—429301-008
13-62
MAXALIGN
°
The following MAPINCLUDE pragma changes only the exact file name n.h
and does not affect the file name machin.h:
mapinclude "n.h" = "e95nh"
°
The following MAPINCLUDE pragma with the FILE option changes the file
name machin.h to machie9h after file-name compression. This is because
the original file name ends in n.h:
MAPINCLUDE FILE n.h = e95nh
However, the file name n.h is not affected by this MAPINCLUDE because it
does not end with the from string. In fact, the name n.h matches the from
string exactly. Therefore, the FILE option should be omitted if your goal is to
change only the n.h file name.
MAXALIGN
The MAXALIGN pragma specifies that objects of a composite type are to be given the
maximum alignment supported by the compiler for the architecture of the host system.
This pragma precedes the data type declaration.
There is no default setting for this pragma.
Usage Guidelines
•
This pragma applies only to definitions of a composite type. For C, composite
types include array types, struct types, and union types. For C++, composite types
also include classes.
•
You do not need to specify this pragma if it appears in the standard header file that
supplies the data type declaration.
•
The size of the type is padded at the end if necessary to make the size an integral
multiple of its alignment.
•
For the TNS/E compiler, the maximum alignment supported is 16 bytes.
Examples
1. #pragma MaxAlign
typedef double jmp_buf[160]; // Aligned at 16 bytes
// instead of 8 bytes
2. #pragma MaxAlign
struct s {
int I;
int J;
MAXALIGN