[PATCH] kms: Fix warning XNFprintf is deprecated

Michel Dänzer michel at daenzer.net
Sat Feb 26 06:32:53 PST 2011


[Dropping dri-devel from CC]

On Fre, 2011-02-25 at 22:07 +0100, Sedat Dilek wrote: 
> Noticed when building ati/radeon ddx against xserver 1.10-rc3.
> 
> [ build.log ]
> ../../src/radeon_kms.c:412:5: warning: 'XNFprintf' is deprecated (declared at /usr/include/xorg/os.h:273)
> 
> Signed-off-by: Sedat Dilek <sedat.dilek at gmail.com>
> ---
>  src/radeon_kms.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/src/radeon_kms.c b/src/radeon_kms.c
> index 158dc57..19b0c74 100644
> --- a/src/radeon_kms.c
> +++ b/src/radeon_kms.c
> @@ -409,7 +409,7 @@ static Bool radeon_open_drm_master(ScrnInfoPtr pScrn)
>  	goto out;
>      }
>  
> -    busid = XNFprintf("pci:%04x:%02x:%02x.%d",
> +    busid = XNFasprintf("pci:%04x:%02x:%02x.%d",
>  		      dev->domain, dev->bus, dev->dev, dev->func);
>  
>      info->dri2.drm_fd = drmOpen("radeon", busid);

Did you test this patch at all? :(

cc1: warnings being treated as errors
../../src/radeon_kms.c: In function ‘radeon_open_drm_master’:
../../src/radeon_kms.c:413: error: passing argument 1 of ‘XNFasprintf’ from incompatible pointer type
/usr/local/include/xorg/Xprintf.h:57: note: expected ‘char **’ but argument is of type ‘char *’
../../src/radeon_kms.c:413: error: passing argument 2 of ‘XNFasprintf’ makes pointer from integer without a cast
/usr/local/include/xorg/Xprintf.h:57: note: expected ‘const char * restrict’ but argument is of type ‘uint16_t’
../../src/radeon_kms.c:413: error: assignment makes pointer from integer without a cast
make[2]: *** [radeon_kms.lo] Error 1
make[2]: Leaving directory `/home/michdaen/src/xorg-git/driver/xf86-video-ati/build-ppc/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/michdaen/src/xorg-git/driver/xf86-video-ati/build-ppc'
make: *** [all] Error 2
make: Leaving directory `/home/michdaen/src/xorg-git/driver/xf86-video-ati/build-ppc'


https://bugs.freedesktop.org/show_bug.cgi?id=34756 looks like it could
be due to this.


I've reverted this for now, please only re-submit after fixing the above
and preferably include a statement about the testing performed.


-- 
Earthling Michel Dänzer           |                http://www.vmware.com
Libre software enthusiast         |          Debian, X and DRI developer


More information about the dri-devel mailing list