Re: [PATCH v2] Make sure packed structs follow the gcc memory layout

2017-09-20 Thread Mark Wielaard
Hi, Looks like you sent this as HTML-only email, which are rejected by the mailinglist. On Mon, 2017-08-21 at 12:57 +0200, Ulf Hermann wrote: > > Wouldn't this be a general problem for  > > any struct that might be layed out differently but that we might > > map to some on-disk data structure?  >

Re: [PATCH v2] Make sure packed structs follow the gcc memory layout

2017-08-19 Thread Mark Wielaard
On Fri, Aug 18, 2017 at 02:05:10PM +0200, Ulf Hermann wrote: > gcc defaults to using struct layouts that follow the native conventions, > even if __attribute__((packed)) is given. In order to get the layout we > expect, we need to tell gcc to always use the gcc struct layout, at > least for packed

[PATCH v2] Make sure packed structs follow the gcc memory layout

2017-08-18 Thread Ulf Hermann
gcc defaults to using struct layouts that follow the native conventions, even if __attribute__((packed)) is given. In order to get the layout we expect, we need to tell gcc to always use the gcc struct layout, at least for packed structs. To do this, we can use the gcc_struct attribute. This is im