This is the mail archive of the 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]
Other format: [Raw text]

Re: [patch] #pragma pack vs. STRUCTURE_SIZE_BOUNDARY

Paul Brook wrote:

On Monday 23 October 2006 04:32, Roger Sayle wrote:

Hi Paul,

On Sun, 22 Oct 2006, Paul Brook wrote:

Given the purpose of #pragma pack is for compatibility with Win32, I
think #pragma pack(1) act the same as __attribute__((packed)).

You've not explicitly mentioned it, but presumably this change reflects
the behaviour of the Microsoft C/C++ compiler on your new pragma-pack-4.c
testcase? Forgive me if I'm a bit slow, and that's implicit.

I don't have MSVC, but I'd be amazed if it doesn't pass the test. i386
{-linux,-mingw32} gcc already pass the test both before and after my patch.

This change only makes a difference on targets where the ABI pads small structures by default (ie have STRUCTURE_SIZE_BOUNDARY > 8). i386 does not define STRUCTURE_SIZE_BOUNDARY.

For what it is worth, I've been using a similar patch for arm-wince-pe for over a year now,
and I can confirm that MSVC, at least for ARM does what Paul's patch does.

Pedro Alves

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