Bug 71837 - Compiler warning from xkb.h on 32bit system
Summary: Compiler warning from xkb.h on 32bit system
Status: RESOLVED MOVED
Alias: None
Product: XCB
Classification: Unclassified
Component: Library (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: xcb mailing list dummy
QA Contact: xcb mailing list dummy
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-20 14:51 UTC by Gatis Paeglis
Modified: 2019-02-16 19:40 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Gatis Paeglis 2013-11-20 14:51:58 UTC
xkb.h:118:5: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]

It comes from:

typedef enum xcb_xkb_control_t {
     XCB_XKB_CONTROL_GROUPS_WRAP = 134217728,
     XCB_XKB_CONTROL_INTERNAL_MODS = 268435456,
     XCB_XKB_CONTROL_IGNORE_LOCK_MODS = 536870912,
     XCB_XKB_CONTROL_PER_KEY_REPEAT = 1073741824,
     XCB_XKB_CONTROL_CONTROLS_ENABLED = 2147483648
 } xcb_xkb_control_t;

appending "u" to 

XCB_XKB_CONTROL_PER_KEY_REPEAT = 1073741824u,
XCB_XKB_CONTROL_CONTROLS_ENABLED = 2147483648u

make the warning go away.
Comment 1 Gatis Paeglis 2014-03-07 15:48:23 UTC
From the C89 standard:

"The type of an integer constant is the first of the corresponding
list in which its value can be represented. Unsuffixed decimal: int,
long int, unsigned long int;"

In the later standards "unsigned long int" is removed from the "Unsuffixed decimal"
list.

If integer constant is suffixed by the letter u or U, then the list is:
unsigned int, unsigned long int, ..

"unsigned long int" is sufficient on 32 bit systems to store the values of
XCB_XKB_CONTROL_PER_KEY_REPEAT and XCB_XKB_CONTROL_CONTROLS_ENABLED
Comment 2 GitLab Migration User 2019-02-16 19:40:32 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/lib/libxcb/issues/10.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.