How to determine if a struct is packed?

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

 



struct my_type {
         uint64_t        base;
         uint8_t         irq;
         uint8_t         numldrv;
         uint8_t         pcibus;
         uint16_t        pcidev;
         uint8_t         pcifun;
         uint16_t        pciid;
         uint16_t        pcivendor;
         uint8_t         pcislot;
         uint32_t        uid;
} __attribute__ ((packed));

Say I have a pointer to a my_type struct.  When I run my code, I
expected that the expr->ctype->ctype.alignment would be 1 but it's 8
because the base struct member is 8 bytes.

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux