Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2008
Visual Studio
Visual C++
C/C++ Build Errors
 Compiler Warning (level 1) C4103
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
Visual C++ Concepts: Building a C/C++ Program
Compiler Warning (level 1) C4103

Error Message

'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
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker