Patrik Stridvall wrote:
So it seems that if we add a -malign-double to CFLAGS we can remove the warning in pshpack8.h since now it will hopefully work correctly.
Yes. However, the -malign-double option obviously causes GCC to produce code that in some cases does not conform to the Linux/i386 ABI. So, if Wine were to call any standard library routines whose ABI is affected by -malign-double (because a parameter is a structure type which is layed out differently), we'd have a problem here ...
Arrgggghhhhhhhh!!! :-(
The alternative would be to add an explict __attribute__((aligned(8))) to all types larger than 4 bytes that can be used by #pragma pack(8) aligned structures.
Of course potentially all types could teoretically be used so that would be VERY ugly...
Patrik Stridvall ps@leissner.se writes:
Of course potentially all types could teoretically be used so that would be VERY ugly...
In theory maybe, but in practice I think there are very few structures where this would be a problem. So we can simply fix the alignment explicitly in these structures, either with padding or with __attribute__.
A nice thing to have would be a script that parses the headers and generates code to dump the size of all structures and the offsets of all their members. Then we can build that code under Windows and Winelib and compare the results. I'm sure it's a 10 minute hack for you to extend winapi_check to do this <g>