On Fri, 9 Nov 2012 17:29:09 +0300 Vasily Khoruzhick <anars...@gmail.com> wrote:
> On Fri, Nov 9, 2012 at 5:19 PM, Timo Teras <timo.te...@iki.fi> wrote: > > On Fri, 9 Nov 2012 17:08:16 +0300 Vasily Khoruzhick > > <anars...@gmail.com> wrote: > > > >> That could be an alignment issue, could you guys try attached > >> patch? At least it should not break anything. > > > > It should not be. The structure is aligned properly - though adding > > the packed attribute is probably a good idea. > > I mean structure fields alignment. > sizeof() and offset of fields could differ on different platforms if > you do not specify "packed" attribute > explicitly Yes, but it depends on your structure. This happens only if the fields are not aligned to architecture specific minimum required alignment. I have there only 8-bit and 16-bit wide fields, and the 16-bit wide ones are 16-bit aligned. According to current C standards this would be always returning the same layout. But yes, the packed attribute is useful to add, so the reader understands that the structure is actually a wire format structure. And also to make sure the compiler won't try anything "too smart". - Timo _______________________________________________ fprint mailing list fprint@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/fprint