Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Compiler Warning (level 1) C4103

'filename' : alignment changed after including header, may be due to missing #pragma pack(pop)

Packing affects the layout of classes, and commonly, if packing changes across header files, there can be problems.

Use #pragma pack(pop) before exiting the header file to resolve this warning.

The following sample generates C4103:

// C4103.h
#pragma pack(push, 4)

// defintions and declarations

// uncomment the following line to resolve
// #pragma pack(pop)

And then,

// C4103.cpp
// compile with: /LD /W1
#include "c4103.h"   // C4103
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.