The LOCALITY_ALL pragma specifies a name to be associated with the linker procedures and global variables that should be grouped together at program binding or load time.
These are written to a relocatable object module. All procedures and global variables following the LOCALITY_ALL pragma are associated with the name specified in the string.
VERSIONID
#pragma VERSIONID "string"
string is a string of characters that HP aC++ places in the object file.
The VERSIONID pragma specifies a version string to be associated with a particular piece of code. The string is placed into the object file produced when the code is compiled.
For example, the directive
#pragma VERSIONID "Software Product, Version 12345.A.01.05"
places the characters Software Product, Version 12345.A.01.05 into the object file.
Data Alignment Pragmas
This section discusses the data alignment pragmas and their various arguments available on
ALIGN
#pragma align N
N is a number raised to the power of 2.
HP aC++ supports
#pragma | align 2 |
char c; | // "c" is at least aligned on 2 byte boundary. |
#pragma align 64
int i, a[10]; // "i" and array "a" are at least aligned 64 byte boundary.
// the size of "a" is still 10*sizeof(int)
PACK
#pragma PACK [n][pushpop][,<name>][,n]show]
n can be 1, 2, 4, 8, or 16 bytes. If n is not specified, maximum alignment is set to the default value.
This
NOTE: The result of applying #pragma pack n to constructs other than class definitions (including struct definitions) is undefined and not supported. For example:
#pragma pack 1
int global_var; // Undefined behavior: not a class definition
void foo() { // Also undefined
}
Example:
struct S1 { |
|
char c1; | // Offset 0, 3 bytes padding |
98 Pragma Directives and Attributes