<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - compiler padding causes reply parsing to use incorrect offsets"
href="https://bugs.freedesktop.org/show_bug.cgi?id=23403#c7">Comment # 7</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW --- - compiler padding causes reply parsing to use incorrect offsets"
href="https://bugs.freedesktop.org/show_bug.cgi?id=23403">bug 23403</a>
from <span class="vcard"><a class="email" href="mailto:consume.noise@gmail.com" title="Daniel Martin <consume.noise@gmail.com>"> <span class="fn">Daniel Martin</span></a>
</span></b>
<pre>(In reply to <a href="show_bug.cgi?id=23403#c5">comment #5</a>)
<span class="quote">> 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.</span >
Imho asserts at compile time are to late. The generator should complain about
that.
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.)</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>