I really don't understand why align=4 isn't correct. I always thought that #pragma pack only affects members of the structure. And __declspec(align(n)) specifies the alignment for objects of type. In MSVS align for B is 4 and for A is 1.