[Xcb] xcb-proto commit f91186b9f3 (dri2 padding) breaks build

Alan Coopersmith alan.coopersmith at oracle.com
Mon May 17 15:49:57 PDT 2010


I cannot build libxcb when commit f91186b9f3e55e1d478476749c929b86e2865cc8
is present, but going back to the previous commit allows it to build fine.

With that commit in place, building gives the error:

"dri2.c", line 332: cannot take sizeof void

The code from the generated dri2.c here is:

    328 void *
    329 xcb_dri2_connect_alignment_pad (const xcb_dri2_connect_reply_t *R  /**< */)
    330 {
    331     xcb_generic_iterator_t prev = xcb_dri2_connect_driver_name_end(R);
    332     return (void *) ((char *) prev.data + XCB_TYPE_PAD(void, prev.index)
+ 0);
    333 }

After cpp expansion the last line has become:

return (void *) ((char *) prev.data +  ( - ( prev . index ) & ( sizeof ( void )
> 4 ? 3 : sizeof ( void ) - 1 ) ) + 0);

and like the compiler, I have no idea what size a "void" is.

Is something wrong in the code generator that's generating different code here
for me, or does gcc allow taking the size of sizeless types like void?

(I'm building on OpenSolaris with the Sun compilers.)

-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System



More information about the Xcb mailing list