From mboxrd@z Thu Jan 1 00:00:00 1970 From: ydroneaud@opteya.com (Yann Droneaud) Date: Tue, 15 Jan 2013 10:59:05 +0100 Subject: struct nbd_reply not packed => trouble? In-Reply-To: References: <50EEE7BD.1040306@pipping.org> <7b5d7212825fa4fa39c6bc2118ce3c9f.squirrel@webmail.ouvaton.coop> Message-ID: <1358243945.3741.5.camel@dworkin.quest-ce.net> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org Hi, Le mardi 15 janvier 2013 ? 07:59 +0800, ??? a ?crit : > > ? 2013-1-11?0:42?"Yann Droneaud" ??? > >> - Any ideas for a platform where you would expect struct nbd_reply to > >> be other than 4 + 4 + 8 = 16 bytes in size? > > > > Look for an ABI that require 'char' with either property: > > - size > 1 byte > > - alignment > 8 (16 bytes !) > > > > > > Do you mean this structure size will vary on different platform? If yes, why Linux does not packed here? Thanks > There's probably no such architecture for a general purpose processor with the ABI properties I've mentionned. eg. (sizeof(char) > 1 || alignof(char) > 8). And if one day Linux is going to be ported on such target, the packing of the nbd_reply struct will be the smallest problem to fix. Regards -- Yann Droneaud OPTEYA