From owner-freebsd-hackers@FreeBSD.ORG Mon Dec 5 13:39:03 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 AF4F21065673; Mon, 5 Dec 2011 13:39:03 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5DDBA8FC0A; Mon, 5 Dec 2011 13:39:03 +0000 (UTC) Received: by ggnp1 with SMTP id p1so2958835ggn.13 for ; Mon, 05 Dec 2011 05:39:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=PsC1HzLijqFC/AsuEeYRqz9VshQWzuFRP5iZ/24mSZk=; b=FrIIUoFof4B4gP1b+npxcn63Q9MnbahI280EPao2DoWxUYbuKd6FDNKTqedMuTc3pu SjejrxJ+pOAkxnYZ8Lkfl2v9y8yNsJd4QqhtST10rjm87V/yB+4GmW9jWP6/2K+CPFBb eh/crsP48DdYg2MVjUDxRYHa0vMwuVkuBTW8I= MIME-Version: 1.0 Received: by 10.182.231.38 with SMTP id td6mr340813obc.66.1323090975419; Mon, 05 Dec 2011 05:16:15 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.182.142.101 with HTTP; Mon, 5 Dec 2011 05:16:15 -0800 (PST) In-Reply-To: <20111204222203.GA8898@freebsd.org> References: <20111204222203.GA8898@freebsd.org> Date: Mon, 5 Dec 2011 16:16:15 +0300 X-Google-Sender-Auth: 1KbpfYPYsO9HpUFl_gQ2T5Laoo0 Message-ID: From: Sergey Kandaurov To: Alexander Best Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org 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 13:39:03 -0000 On 5 December 2011 02:22, Alexander Best wrote: > hi there, > > i was going through the clang warnings from a GENERIC buildkernel and not= iced > the following: > > =3D=3D=3D> 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-specifi= er] > =A0 =A0 =A0 =A0BEGIN_DMA(2); > =A0 =A0 =A0 =A0^~~~~~~~~~~ > @/dev/drm/mga_drv.h:291:35: note: expanded from: > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0DRM_INFO( " =A0 space=3D0x%x req=3D0x%Zx\n= ", =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0\ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0^ > @/dev/drm/drmP.h:317:60: note: expanded from: > #define DRM_INFO(fmt, ...) =A0printf("info: [" DRM_NAME "] " fmt , ##__VA= _ARGS__) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ^ > these lines should cover all warnings: > > otaku% egrep -r "%[0-9]*Zx" /usr/src/sys/dev/drm > dev/drm/mga_drv.h: =A0 =A0 =A0 =A0 =A0 =A0 =A0DRM_INFO( " =A0 space=3D0x%= x req=3D0x%Zx\n", =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0\ > dev/drm/mga_drv.h: =A0 =A0 =A0 =A0 =A0 =A0 =A0DRM_INFO( " =A0 DMA_WRITE( = 0x%08x ) at 0x%04Zx\n", =A0 =A0 =A0 =A0\ > > ... i couldn't find a reference to an upercase "Z" in the printf(9) man p= age. > i talked to dinoex on #freebsd-clang (EFNet) and he said that the "Z" mig= ht > 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. Index: sys/dev/drm/mga_drv.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/dev/drm/mga_drv.h (revision 228276) +++ sys/dev/drm/mga_drv.h (working copy) @@ -288,7 +288,7 @@ do { \ if ( MGA_VERBOSE ) { \ DRM_INFO( "BEGIN_DMA( %d )\n", (n) ); \ - DRM_INFO( " space=3D0x%x req=3D0x%Zx\n", = \ + DRM_INFO( " space=3D0x%x req=3D0x%x\n", = \ dev_priv->prim.space, (n) * DMA_BLOCK_SIZE ); \ } \ prim =3D dev_priv->prim.start; \ @@ -338,7 +338,7 @@ #define DMA_WRITE( offset, val ) \ do { \ if ( MGA_VERBOSE ) { \ - DRM_INFO( " DMA_WRITE( 0x%08x ) at 0x%04Zx\n", \ + DRM_INFO( " DMA_WRITE( 0x%08x ) at 0x%04x\n", \ (u32)(val), write + (offset) * sizeof(u32) ); \ } \ *(volatile u32 *)(prim + write + (offset) * sizeof(u32)) =3D val; \ --=20 wbr, pluknet