Date: Mon, 05 Dec 2011 23:55:14 +0200 From: Andriy Gapon <avg@FreeBSD.org> To: Alexander Best <arundel@FreeBSD.org> Cc: freebsd-hackers@FreeBSD.org, Sergey Kandaurov <pluknet@FreeBSD.org> Subject: Re: strange printf(9) format specifier ("Z") in dev/drm code Message-ID: <4EDD3DC2.1020405@FreeBSD.org> In-Reply-To: <20111205143815.GA34379@freebsd.org> References: <20111204222203.GA8898@freebsd.org> <CAE-mSOJEwc9ESmCeOpiCujenuPAZfLjPi4sAJ7aJYOz4_XEkAQ@mail.gmail.com> <20111205143815.GA34379@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
on 05/12/2011 16:38 Alexander Best said the following: > On Mon Dec 5 11, Sergey Kandaurov wrote: >> On 5 December 2011 02:22, Alexander Best <arundel@freebsd.org> wrote: >>> hi there, >>> >>> i was going through the clang warnings from a GENERIC buildkernel and noticed >>> the following: >>> >>> ===> drm/mga (all) >>> /usr/subversion-src/sys/modules/drm/mga/../../../dev/drm/mga_state.c:56:2: error: invalid conversion specifier 'Z' [-Werror,-Wformat-invalid-specifier] >>> BEGIN_DMA(2); >>> ^~~~~~~~~~~ >>> @/dev/drm/mga_drv.h:291:35: note: expanded from: >>> DRM_INFO( " space=0x%x req=0x%Zx\n", \ >>> ^ >>> @/dev/drm/drmP.h:317:60: note: expanded from: >>> #define DRM_INFO(fmt, ...) printf("info: [" DRM_NAME "] " fmt , ##__VA_ARGS__) >>> ^ >>> these lines should cover all warnings: >>> >>> otaku% egrep -r "%[0-9]*Zx" /usr/src/sys/dev/drm >>> dev/drm/mga_drv.h: DRM_INFO( " space=0x%x req=0x%Zx\n", \ >>> dev/drm/mga_drv.h: DRM_INFO( " DMA_WRITE( 0x%08x ) at 0x%04Zx\n", \ >>> >>> ... i couldn't find a reference to an upercase "Z" in the printf(9) man page. >>> i talked to dinoex on #freebsd-clang (EFNet) and he said that the "Z" might >>> come from linux'es libc5 and is the equaivalent to glibc's "z". >>> >>> can we adjust those lines, so the clang warnings disappear? >> >> Hi, Alexander. >> >> Can you build-test with this change? >> Thanks in advance. > > no that didn't work, but the following patch fixed it for me. What about Z => z ? -- Andriy Gapon
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4EDD3DC2.1020405>