[Xcb] c_client.py: enumerator values generation

Litvinenko, Evgeny EVLitvinenko at luxoft.com
Sun Jan 15 01:51:32 UTC 2017


Hi.

I've tried to build libxcb-1.12 (with gcc option -pedantic-errors)
and got the following error:

In file included from xinput.c:14:0:
xinput.h:3079:35: error: ISO C restricts enumerator values to range of 'int' [-Wpedantic]
     XCB_INPUT_MODIFIER_MASK_ANY = 2147483648

The file xinput.h is generated during build by python script 'c_client.py'
(https://cgit.freedesktop.org/xcb/libxcb/tree/src/c_client.py)
as follows:

/usr/bin/python ./c_client.py   -c "libxcb 1.12" -l "X Version 11" \
        -s "3" -p /usr/lib/python2.7/site-packages \
         \
        /usr/share/xcb/xinput.xml

The resulted file xinput.h contains the structure that gives the error:

    typedef enum xcb_input_modifier_mask_t {
        XCB_INPUT_MODIFIER_MASK_ANY = 2147483648
    } xcb_input_modifier_mask_t;

The structure is generated based on the followin code in xcb/proto/src/xinput.xml
(https://cgit.freedesktop.org/xcb/proto/tree/src/xinput.xml)

    <enum name="ModifierMask">
        <item name="Any"> <bit>31</bit> </item>
    </enum>

Is it correct that xinput.h has number 2147483648 (which is 32bit long)
where as we have '<bit>31</bit>' in xinput.xml?

Thanks,
Evgeny.

________________________________

This e-mail and any attachment(s) are intended only for the recipient(s) named above and others who have been specifically authorized to receive them. They may contain confidential information. If you are not the intended recipient, please do not read this email or its attachment(s). Furthermore, you are hereby notified that any dissemination, distribution or copying of this e-mail and any attachment(s) is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender by replying to this e-mail and then delete this e-mail and any attachment(s) or copies thereof from your system. Thank you.


More information about the Xcb mailing list