This is the mail archive of the cygwin mailing list for the Cygwin 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: Cygwin struct alignment


On Mon, 29 Dec 2008, John Emmas wrote:

> Yesterday I spent some time looking into this but didn't come to any
> hard & fast conclusions.   Variables themselves seem to correlate very well
> between MSVC and Cygwin (even 'long' which I thought was different).  But
> when calculating structure alignment (manually) sometimes Cygwin gave
> closer results to what I expected and sometime MSVC was closer.

The only major difference I'm aware of is that Cygwin defaults to 8 byte
alignment for long long and double for performance reasons, while MSVC
defaults to 4 byte alignment for those types I believe.

> Before I try Ralph's suggestion I'd like (if possible) to try building both
> versions with struct packing disabled.  This is fairly simple to do with
> Microsoft's compiler (I just set the member alignment to '1 byte') but can
> it be done for my Cygwin compiler - e.g. with a compiler option or a #pragma
> or whatever?

Google attribute packed as I don't remember the exact syntax, but I fail
to see how this actually helps your cause.

-- 
Brian Ford
Staff Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
the best safety device in any aircraft is a well-trained crew...

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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