This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] #pragma pack vs. STRUCTURE_SIZE_BOUNDARY
- From: Paul Brook <paul at codesourcery dot com>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 23 Oct 2006 13:37:59 +0100
- Subject: Re: [patch] #pragma pack vs. STRUCTURE_SIZE_BOUNDARY
- References: <Pine.LNX.4.44.0610222126170.5138-100000@www.eyesopen.com>
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.
Paul