Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Sep 2010 14:52:51 +0100
From:      "Robert N. M. Watson" <rwatson@FreeBSD.org>
To:        Fabian Keil <freebsd-listen@fabiankeil.de>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: zfs + uma
Message-ID:  <F100D77A-CE16-40DE-B441-02E702B12686@FreeBSD.org>
In-Reply-To: <20100918143516.3568f40e@r500.local>
References:  <4C93236B.4050906@freebsd.org> <4C935F56.4030903@freebsd.org> <alpine.BSF.2.00.1009181221560.86826@fledge.watson.org> <20100918143516.3568f40e@r500.local>

next in thread | previous in thread | raw e-mail | index | archive | help

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=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F100D77A-CE16-40DE-B441-02E702B12686>