[Xcb] [Bug 23403] compiler padding causes reply parsing to use incorrect offsets

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Dec 17 07:35:10 PST 2012


--- Comment #7 from Daniel Martin <consume.noise at gmail.com> ---
(In reply to comment #5)
> Given that there's already assumptions about compiler padding behavior as
> Josh notes, would the project accept a patch that makes c_client.py add
> explicit packing attributes to protocol structures? I could also add
> compile-time asserts to prevent bugs of this form from cropping up again.

Imho asserts at compile time are to late. The generator should complain about

My suggestion would be:

a) handle "packed" from the beginning
   - add a "packed" attribute to the struct in the schema (xcb.xsd)
   - handle it in xtypes.py
   - handle it in c_client.py
b) preventive measures:
   - enhance xtypes.py to watch out for unpadded structs

>From my pov those additions don't sound hard to realize. (Well, I played with
length handling during the past 1,5 week for xinput.)

You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/xcb/attachments/20121217/6af6cfcd/attachment.html>

More information about the Xcb mailing list