Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-developers-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin-developers AT sourceware DOT cygnus DOT com Message-ID: <372F5765.35BFBD66@hem2.passagen.se> Date: Tue, 04 May 1999 22:24:05 +0200 From: Anders Norlander X-Mailer: Mozilla 4.01 [en] (Win95; I) MIME-Version: 1.0 To: Mumit Khan CC: DJ Delorie , cygwin-developers AT sourceware DOT cygnus DOT com Subject: Re: Patch, Version 4: Problem solved X-Priority: 3 (Normal) References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mumit Khan wrote: > > On Tue, 4 May 1999, DJ Delorie wrote: > > > The alignment of A changes from 4 bytes (sizeof(int)) to 8 bytes > > (sizeof(double)), so the alignment of B (which contains A) must also > > change from 4 to 8. The size of B is increased to a multiple of the > > alignment so that each element of an array of such objects is properly > > aligned. IMHO, this is correct and expected behavior. > > Exactly. Yes, I agree to this as well. Although old gcc don't. > > If MS wants them "less aligned" you'll have to use gcc's alignment > > directives to reduce the alignment of that double to 4. > > MS and GNU do agree on this for a change! The bug is elsewhere since as > far as I can tell, MS and GNU are doing exactly the same thing (I did try > out Anders' code posted to egcs-bugs, and get the same result, as expected > in this particular case, from MSVC 5.0 and EGCS-1.1.2). > > Anders, are you sure the code for the particular structure is in the right > packing mode (I believe it should pack(4) for LUID_AND_ATTRIBUTES)? Hmm. I hadn't considered that MS may have used different packings. > I also checked the code using `#pragma pack(4)', and get the same result > from both compilers. The question is should we go for PACKED on particular structures or should everything in winnt be pack(4)? Regards, Anders