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

Table Of Contents
Compiler Pragmas
HP C/C++ Programmer’s Guide for NonStop Systems429301-010
13-33
FORCE_VTBL
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: ----------------------------------
| c1 | filler |
----------------------------------
| <0:2=b1><3:5=b2><6:15=filler> |
----------------------------------
| <0:11=b3><12:15=filler> |
----------------------------------
| c2 | |
----------------------------------
5. This example shows the alignment of a structure with an array member:
#pragma fieldalign shared2
struct { char c1;
struct { char c2;
int i1;
} a[2];
} s1;
s1: ----------------------------------
| c1 | a[0].c2 |
----------------------------------
|a[0].i1 |
----------------------------------
|filler for a[0] | a[1].c2 |
----------------------------------
|a[1].i1 |
----------------------------------
|filler for a[1] | |
----------------------------------
FORCE_VTBL
The FORCE_VTBL command-line option forces definition of virtual function tables in
cases where the heuristic used by the compiler to decide on definition of virtual
function tables provides no guidance. The default behavior is to make the definition a
local static entity. This option is valid only for native C++.
FORCE_VTBL