From owner-freebsd-hackers@FreeBSD.ORG Mon Dec 5 21:55:20 2011 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F414106566B; Mon, 5 Dec 2011 21:55:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 489408FC16; Mon, 5 Dec 2011 21:55:18 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id XAA19458; Mon, 05 Dec 2011 23:55:17 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1RXgVI-000LJn-N6; Mon, 05 Dec 2011 23:55:16 +0200 Message-ID: <4EDD3DC2.1020405@FreeBSD.org> Date: Mon, 05 Dec 2011 23:55:14 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111108 Thunderbird/8.0 MIME-Version: 1.0 To: Alexander Best References: <20111204222203.GA8898@freebsd.org> <20111205143815.GA34379@freebsd.org> In-Reply-To: <20111205143815.GA34379@freebsd.org> X-Enigmail-Version: undefined Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@FreeBSD.org, Sergey Kandaurov Subject: Re: strange printf(9) format specifier ("Z") in dev/drm code X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2011 21:55:20 -0000 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 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