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


John Emmas wrote:
Christopher / Reini - thanks for your tips.

John, here's a quote from your original email:


> As things stand, both client and server use System V shared memory and
> everything works well if I compile under Cygwin or Linux.  Ultimately
> however, there'll be no Linux clients.  The clients will either be
> Cygwin clients or Windows clients.  Therefore I'm currently
> experimenting to see if I can change the server to use Windows shared
> memory (only under Cygwin of course - not for Linux use).

I'll repeat my original statement, which is that you will run screaming
from your workstation before you will make two separate compilers
understand each other's structure packing and struct alignment
consistently.

You might end up packing individual structs OK, but nested structs may
end up aligned on full 32 or 64 bit boundaries again.

I've been through this with HC16 and Blackfin processors, and I'm
running into it with ARM devices too.

However close you get to the Rosetta Stone of compiler settings, there
will be corner cases that will not work, and you'll have a hell of a
time tracking down the errors.

Have a close look at the RFC I pointed you to, and see if it can help.
Even if you just play with it for fun, there will be another tool
in your belt when you're done.

Ralph


-- 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]