CARD32 vs uint32_t

Jeremy Huddleston Sequoia jeremyhu at apple.com
Sat Sep 17 23:33:29 UTC 2016


libXfont2's _xfont2_client_funcs struct has a get_time_in_millis entry that is declared as 'uint32_t (*get_time_in_millis)(void);'

xserver tries to use GetTimeInMillis for this, but it is declared as 'CARD32 GetTimeInMillis(void)'.  The issue is that CARD32 is actually 'unsigned long' on i386, so the compiler complains about the possible mismatch (even though int and long are the same in such a configuration).

dixfonts.c:2028:27: warning: incompatible pointer types initializing 'uint32_t (*)(void)' (aka 'unsigned int (*)(void)') with an expression of type 'CARD32 (void)'
      (aka 'unsigned long (void)') [-Wincompatible-pointer-types,Semantic Issue]
    .get_time_in_millis = GetTimeInMillis,
                          ^~~~~~~~~~~~~~~
1 warning generated.


I'd really like to see us use stdint.h in Xmd.h.  Are there any arguments against doing such a change?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4465 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg-devel/attachments/20160917/58c3193a/attachment.bin>


More information about the xorg-devel mailing list