This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Byte Alignment 1 for Code using STL


> I'm porting some code from Windows NT 4.0 to Linux SuSE 6.3, Pentium to 
> Pentium.  The whole project compiles on Windows with byte alignment 1 in the 
> project settings of Visual Studio.  To get the same alignment on Linux, I 
> added '#pragma pack(1)' a the beginning of all source file (both .cpp and 
> .h).  The problem I have now, is that some of the STL functions generates 
> Segmentation Faults.  Any idea what I do wrong???

Defining a global alignment is wrong, it will break libraries if the
structure layout changes due alignment. You can only do this in a
freestanding environment (i.e. one without any system libraries).

Regards,
Martin

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]