Mailing List Archive

gcc and plan 8 cc differences ...
I ran into something like this:

typedef struct a {
unsigned long long x;
unsigned long y;
unsigned short z;
} PACKED thing;

8cc (plan 9 cc) has no "PACKED" capability, so 8cc makes this struct out
to be 12 bytes. gcc makes it out to be 10.

I'm wondering if for ease of portability we could consider this; if we're
going to send binary structs around, then make each element in the struct
at least the size of the alignment for that struct on that machine. So,
in this case:


typedef struct a {
unsigned long long x;
unsigned long y;
unsigned long z;
^^^^
} thing;

no packed keyword.


Just wondering. I can work around this, but a compatible declaration would
be nicer.

ron


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xen-devel