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

FIELDALIGN attribute as the non-template base or member class; otherwise the compilation
of such instantiations will fail.
For TNS C++, there are additional restrictions:
FIELDALIGN must be AUTO for inherited classes and their base classes and classes with
virtual member functions.
Templates cannot be specified in FIELDALIGN pragmas and always have FIELDALIGN
AUTO. Nested structs are not implemented for templates. Templates can contain non-AUTO
structs declared using tags.
No other pragmas can appear on the same source line as #pragma FIELDALIGN.
Examples
1. Global pragma FIELDALIGN is allowed anywhere in the source, not just at the beginning,
and it can also be used as an argument to pragmas PUSH and POP. For example:
#pragma fieldalign auto
// the global fieldalign is now set to auto
struct AutoStruct {};
#pragma push fieldalign
//save the current fieldalign value
#pragma fieldalign shared2
// the global fieldalign is now shared2In t
struct Shared2Struct{};
#pragma pop fieldalign
//global fieldalign is restored to auto
2. In this example, the member str1.str2.c2 starts at a byte address instead of the typical
16-bit word address:
#pragma fieldalign shared2 STAG
struct STAG { char c1;
struct { char c2;
int i;
} str2; /* substructure declared
inline without tag */
} str1;
3. In this example, pragma FIELDALIGN SHARED2 causes all structures in the compilation unit
to be the same as TAL’s definition structures, except for any structure with the tag CTAG,
whose members always are 16-bit word-aligned.
#pragma fieldalign shared2
#pragma fieldalign auto CTAG
...
struct CTAG { ...
} cstruct;
...
4. This example shows the alignment of a structure with bit-field members, regardless of whether
pragma WIDE is present or not:
#pragma fieldalign shared2 ATAG
struct ATAG { char c1;
int b1:3;
int b2:3;
int b3:12;
char c2; } s1;
s1: ----------------------------------
FIELDALIGN 193