[Xcb] [PATCH libxcb 13/18] c_client.py: use C99 initializers instead of comments

Ran Benita ran234 at gmail.com
Sun Oct 26 08:33:50 PDT 2014


On Sat, Oct 25, 2014 at 06:26:15PM +0200, Christian Linhart wrote:
> Sequence and names do match correctly as can be seen by comparing it
> with the definition of xcb_protocol_request_t:
> http://cgit.freedesktop.org/xcb/libxcb/tree/src/xcbext.h#n47
> 
> Therefore this does the same, however there may be another problem:
> 
> Is this the first instance in XCB which requires a C99-compliant compiler?

I found a use of "static inline" in xcb_out.c and the following in
xcb_conn.c:

    #if HAVE_SENDMSG
            [...]
            struct msghdr msg = {
                .msg_name = NULL,
                .msg_namelen = 0,
                .msg_iov = *vector,
                .msg_iovlen = n,
                .msg_control = cmsgbuf.buf,
                .msg_controllen = CMSG_LEN(c->out.out_fd.nfd * sizeof (int)),
            };

And we also use AC_PROG_CC_99 (through xorg-macros) so I think it's OK.

> Intuitively it should be safe to assume that a C99 compliant compiler is available on all relevant platforms.
> 
> But I have one test computer which uses X11 and where this is not the case.
> This test computer is from one of my customers and matches their production system ( at least somehow ).
> XCB may become relevant on that computer.
> 
> This may be a hint that there are more users where pre-C99 compatibility can be relevant.

If xcb needs to be more portable to old compilers, there are few enough
c99isms that I think a patch to remove them will be accepted. But it's
probably better to first see which parts fail to compile.

Ran


More information about the Xcb mailing list