From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <8ea9211edc9a0cad52683bcd6ae3f64d@9netics.com> To: 9fans@cse.psu.edu Subject: Re: [9fans] 8c padding problem Date: Fri, 21 Dec 2007 18:59:56 -0500 From: Skip Tavakkolian <9nut@9netics.com> In-Reply-To: <0b1c493be42d4ca71dcb8864209060a0@quanstro.net> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: 2038586e-ead3-11e9-9d60-3106f5b1d025 >> i am guessing that the requirement of being able to demote a type to >> one of its anonymouse constituents -- as in Node to Lock in Ken's example -- >> would require a uniform layout that makes it easy to calculate the offset. > > however this is the opposite case. the padding is after the > anon. structure. the anon. structure itself is at offset 0. but it doesn't have to be. this is legit: typedef struct{ Ehdr; // 1 Ehdr; // 2 uchar op[2]; }Pkt;