[PATCH 7/7] debug output format fix in xf86Helper.c
Jon TURNEY
jon.turney at dronecode.org.uk
Tue Aug 18 08:32:40 PDT 2015
On 17/08/2015 02:20, Peter Hutterer wrote:
> On Thu, Aug 13, 2015 at 01:11:37PM +0100, Jon TURNEY wrote:
>> xserver/hw/xfree86/common/xf86Helper.c:1834:12: error: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘Atom’ [-Werror=format=]
>> xserver/hw/xfree86/common/xf86Helper.c:1834:12: error: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘Atom’ [-Werror=format=]
>>
>> Atom is unfortunately unsigned long or unsigned int depending on the
>> architecture, so a cast is required.
>
> that's only true for client/Xlib code but in the server it's always 32 bits.
> include/X.h has a section for _XSERVER64 which defines typedef CARD32 Atom;
> so you can change this to just %d instead.
I'm not sure that's quite correct.
In client code, Atom is always unsigned long, to preserve the API.
In the server code, Atom is indeed always 32 bits (CARD32), but in a
32-bit X server that is an unsigned long.
More information about the xorg-devel
mailing list