From owner-freebsd-hackers@FreeBSD.ORG Sat Sep 18 13:52:53 2010 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 C36281065673 for ; Sat, 18 Sep 2010 13:52:53 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 9B6398FC15 for ; Sat, 18 Sep 2010 13:52:53 +0000 (UTC) Received: from [127.0.0.1] (rhee.cl.cam.ac.uk [128.232.1.202]) by cyrus.watson.org (Postfix) with ESMTPSA id 9B05146B09; Sat, 18 Sep 2010 09:52:52 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: "Robert N. M. Watson" In-Reply-To: <20100918143516.3568f40e@r500.local> Date: Sat, 18 Sep 2010 14:52:51 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <4C93236B.4050906@freebsd.org> <4C935F56.4030903@freebsd.org> <20100918143516.3568f40e@r500.local> To: Fabian Keil X-Mailer: Apple Mail (2.1081) Cc: freebsd-hackers@freebsd.org Subject: Re: zfs + uma 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: Sat, 18 Sep 2010 13:52:53 -0000 On 18 Sep 2010, at 13:35, Fabian Keil wrote: > Doesn't build for me on amd64: >=20 > fk@r500 /usr/src/tools/tools/umastat $make > Warning: Object directory not changed from original = /usr/src/tools/tools/umastat > cc -O2 -pipe -fno-omit-frame-pointer -std=3Dgnu99 -fstack-protector = -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter = -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith = -Wno-uninitialized -Wno-pointer-sign -c umastat.c > cc1: warnings being treated as errors > umastat.c: In function 'uma_print_bucketlist': > umastat.c:234: warning: format '%llu' expects type 'long long unsigned = int', but argument 3 has type 'uint64_t' > umastat.c:234: warning: format '%llu' expects type 'long long unsigned = int', but argument 4 has type 'uint64_t' > umastat.c: In function 'uma_print_cache': > umastat.c:245: warning: format '%llu' expects type 'long long unsigned = int', but argument 3 has type 'u_int64_t' > umastat.c:246: warning: format '%llu' expects type 'long long unsigned = int', but argument 3 has type 'u_int64_t' > umastat.c: In function 'main': > umastat.c:416: warning: format '%llu' expects type 'long long unsigned = int', but argument 2 has type 'u_int64_t' > umastat.c:418: warning: format '%llu' expects type 'long long unsigned = int', but argument 2 has type 'u_int64_t' > umastat.c:420: warning: format '%llu' expects type 'long long unsigned = int', but argument 2 has type 'u_int64_t' > umastat.c:426: warning: dereferencing type-punned pointer will break = strict-aliasing rules > umastat.c:429: warning: dereferencing type-punned pointer will break = strict-aliasing rules > *** Error code 1 >=20 > Stop in /usr/src/tools/tools/umastat. >=20 > The attached patch seems to work around the problem, I'm not sure if > the casts to void* are better than decreasing the WARN level, though = ... This is a 32-bit/64-bit issue. Probably all pointers printing should be = converted to %p, and large integer types to %ju and %jd, perhaps with a = cast first to intmax_t or uintmax_t if required. Robert=