[Xcb] Invalid XIDs

Peter Harris git at peter.is-a-geek.org
Mon Jan 26 08:35:37 PST 2009


On Mon, Jan 26, 2009 at 1:30 AM, Barton C Massey wrote:
> In message <961fa2b40901251643x5155f7bcpf2422b930eec8103 at mail.gmail.com> you wrote:
>> (It's also unclear to me that there's anything anyone can do with an
>> error return from xcb_generate_id -- does anyone even check?  Is it
>> even guaranteed that (uint32_t)-1 indicates an error, rather than a
>> valid XID?)
>
> Well, we control the XCB spec, so I say "yes" on the
> guarantee. :-)

Better than that, the most significant three bits are reserved by the
X protocol spec (page 10). So no valid XID will ever have those bits
set.

> Which means that we should check for that
> case in the xcb_generate_id code.  Noted and fixed in my
> branch.

No need (see above), but extra validation doesn't hurt.

Peter Harris


More information about the Xcb mailing list