[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] gcc and plan 8 cc differences ...


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxxx
  • From: "Ronald G. Minnich" <rminnich@xxxxxxxx>
  • Date: Thu, 21 Oct 2004 15:01:15 -0600 (MDT)
  • Delivery-date: Thu, 21 Oct 2004 22:08:37 +0100
  • List-id: List for Xen developers <xen-devel.lists.sourceforge.net>

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@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.