[PATCH 28/44] xfree86/dri: Mark DRIDrvMsg and dri_drm_debug_print _X_ATTRIBUTE_PRINTF

Mark Kettenis mark.kettenis at xs4all.nl
Fri Dec 13 13:07:18 PST 2013


> From: Adam Jackson <ajax at nwnk.net>
> Date: Fri, 13 Dec 2013 15:42:56 -0500
> 
> On Wed, 2013-12-11 at 12:24 -0800, Keith Packard wrote:
> > And fix resulting warnings.
> > 
> > Signed-off-by: Keith Packard <keithp at keithp.com>
> > Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
> 
> Just tried to build this and got:
> 
> dri.c: In function 'DRILock':
> dri.c:2228:46: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>                    pDRIPriv->pLockingContext, (void *) pDRIPriv->myContext);
>                                               ^
> dri.c: In function 'DRIUnlock':
> dri.c:2246:50: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>                        pDRIPriv->pLockingContext, (void *) pDRIPriv->myContext);
>                                                   ^
> 
> Hooray for LP64.  These need to be (void *) (uintptr_t) foo.

It makes much more sense to consistently print drm_context_t as %u or
0x%x.  It's an unsigned int on both OpenBSD and Linux, so I suspect
that's the case everywhere.


More information about the xorg-devel mailing list