[Xcb] [PATCH] Force XCB event structures with 64-bit extended fields to be packed.

Mark Kettenis mark.kettenis at xs4all.nl
Tue Dec 31 14:52:53 PST 2013


>  On 12/31/2013 12:06 AM, Mark Kettenis wrote:
> > I also don't quite trust the compiler to get to emit the right
> > instructions for unaligned access on all platforms.
>
>  I would be really surprised if it didn't.  If a compiler can't generate
>  code to read a field of a packed structure in 2013 (even
>  inefficiently)...wow, that's a bad compiler.

GCC is a fairly bad compiler.  What typically happens is that some
optimization step throws away the knowledge about alignment and a "normal"
load or store instruction is emitted.  It's a class of bugs that keeps
coming back because the dominant architecture of the day is fairly
forgiving in this respect.




More information about the Xcb mailing list