The _Packed keyword tells the compiler to ignore the padding and pack the structure as much as possible.
In ILE C this keyword can be used in a structure definition and type
definition.
In ILE C++, the same keyword can be used only in a type definition.
Table 17. Comparing Packed Structures
ILE C/400 | ILE C/C++ | |
---|---|---|
typedef _Packed struct { . . }ps_t; | ok | ok |
_Packed struct { . . }ps_v; | ok | error |
Therefore, you must make sure the _Packed keyword is used only in type definitions located in the header file.
In the ILE C/C++ compiler, the #pragma pack directive applies only to
C programs. The ILE C #pragma pack directive is not compatible
with the Windows(R) #pragma pack directive.
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.