Re: Cygwin struct alignment

2008-12-29 Thread John Emmas
- Original Message - From: "Christopher Faylor" I still can't shake the feeling that you're attempting to do this with trial and error and googling rather than reading the gcc documentation. Reading the documentation?? That's cheating, isn't it? ;-)) -- Unsubscribe info: http:/

Re: Cygwin struct alignment

2008-12-29 Thread John Emmas
Thanks Ralph, I haven't forgotten your link. My initial thoughts were that it seemed very impressive but there's a lot to take in. I'm intending to take a good hard look at it over the new year period John -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports:

Re: Cygwin struct alignment

2008-12-29 Thread Christopher Faylor
On Mon, Dec 29, 2008 at 06:29:09PM -, John Emmas wrote: > Christopher / Reini - thanks for your tips. > >On Mon, Dec 29, 2008 at 07:09:30PM +0100, Reini Urban wrote: >>Which "Cygwin compiler"? I have about a dozen compilers in my cygwin >>environment. If you mean gcc-core-3.4.4-3 or >>gcc-min

Re: Cygwin struct alignment

2008-12-29 Thread Ralph Hempel
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.

Re: Cygwin struct alignment

2008-12-29 Thread John Emmas
Christopher / Reini - thanks for your tips. - Original Message - From: "Reini Urban" Which "Cygwin compiler"? I have about a dozen compilers in my cygwin environment. If you mean gcc-core-3.4.4-3 or gcc-mingw-core-3.4.4-20050522-1 please say so. Oops sorry, I did miss out that impor

Re: Cygwin struct alignment

2008-12-29 Thread Reini Urban
John Emmas schrieb: - Original Message - From: "Ralph Hempel" Sent: 24 December 2008 19:47 Subject: Re: Cygwin struct alignment John, if I understand you correctly, you are running up against a classic problem in embedded systems programming. Namely that you cannot assum

Re: Cygwin struct alignment

2008-12-29 Thread Christopher Faylor
On Mon, Dec 29, 2008 at 09:00:36AM -, John Emmas wrote: >On Mon, Dec 24, 2008 at 19:47 Ralph Hempel wrote: >>John, if I understand you correctly, you are running up against a >>classic problem in embedded systems programming. Namely that you >>cannot assume anything about structure packing, by

Re: Cygwin struct alignment

2008-12-29 Thread John Emmas
- Original Message - From: "Brian Ford" Subject: Re: Cygwin struct alignment Google attribute packed as I don't remember the exact syntax, but I fail to see how this actually helps your cause. Thanks Brian. It should help me because it will hopefully guarantee that

Re: Cygwin struct alignment

2008-12-29 Thread Brian Ford
On Mon, 29 Dec 2008, Brian Ford wrote: > 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. Actually, I remebered one more difference. I think

Re: Cygwin struct alignment

2008-12-29 Thread Brian Ford
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 align

Re: Cygwin struct alignment

2008-12-29 Thread John Emmas
- Original Message - From: "Ralph Hempel" Sent: 24 December 2008 19:47 Subject: Re: Cygwin struct alignment John, if I understand you correctly, you are running up against a classic problem in embedded systems programming. Namely that you cannot assume anything about structu

Re: Cygwin struct alignment

2008-12-24 Thread John Emmas
Thanks Ralph, I'm still experimenting at the moment but that was very helpful. John -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.c

Re: Cygwin struct alignment

2008-12-24 Thread Ralph Hempel
John Emmas wrote: Actually, this is turning out to be slightly more complicated than I thought. Member alignment for very simple structs seems to correlate pretty well but more complex structs cause subtle (though hopefully not insurmountable) problems.. Is it possible (in Cygwin) to disab

Re: Cygwin struct alignment

2008-12-24 Thread John Emmas
- Original Message - From: "John Emmas" Subject: Cygwin struct alignment I'd assumed that Cygwin probably wouldn't use structure packing (only because I don't think Linux does). But I only get meaningful data with 8-byte packing. It looks as if Cygwin

Cygwin struct alignment

2008-12-24 Thread John Emmas
A program I'm building connects to a (Cygwin) server and receives the address of a shared memory segment. The memory contains an array of struct and you probably know that Microsoft (by default) aligns structure members on 8-byte boundaries (sometimes called 8-byte packing). As things stand, bot