Hi,tinyos-help,

I just test gcc/nesc attribute, "__attribute__ ((packed))" . 
When I compile the following struct in PC platform, the struct is not one byte 
alligned.  sizeof(struct foo) is 16.
typedef struct foo{
        uint8_t a;
        uint64_t b;
};

while in the case of 

typedef struct foo{
        uint8_t a;
        uint64_t b;
}__attribute__ ((packed));

sizeof(struct foo) is 9.

This is easy to understand.

But when I compile the same struct to a mica or micaz flatform. sizeof(struct 
foo) is always 9 regardless  __attribute__ ((packed)) is used or not.

Why? Is NesC deal all the structs defination in tinyos as packed format?



                        
Best regards,
                                 
Shang
2007-08-21
                                 



_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to