Date: Sat, 20 Jan 2007 20:56:44 +0100 From: Max Laier <max@love2party.net> To: freebsd-current@freebsd.org Cc: amd64@freebsd.org, Alexander Leidinger <Alexander@leidinger.net>, FreeBSD Tinderbox <tinderbox@freebsd.org> Subject: Re: [head tinderbox] failure on amd64/amd64 Message-ID: <200701202056.53825.max@love2party.net> In-Reply-To: <20070120203242.61bf253d@Magellan.Leidinger.net> References: <20070120182210.56EBD73034@freebsd-current.sentex.ca> <20070120203242.61bf253d@Magellan.Leidinger.net>
next in thread | previous in thread | raw e-mail | index | archive | help
--nextPart584704435.sdW9kyYMz7 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Saturday 20 January 2007 20:32, Alexander Leidinger wrote: > Quoting FreeBSD Tinderbox <tinderbox@freebsd.org> (Sat, 20 Jan 2007=20 13:22:10 -0500 (EST)): > > /src/sys/compat/linprocfs/linprocfs.c: In function > > `linprocfs_doprocstat': /src/sys/compat/linprocfs/linprocfs.c:478: > > warning: int format, different type arg (arg 3) *** Error code 1 > > Does someone has a table of common 32/64 bit printf issues and the > corresponding DTRT handling of the issues? To fix this I used something > which I did found somewhere in the kernel, but I'm not sure if it is > the best way to fix it. I could have casted it to int instead of > keeping the precision sizeof() is offering (casting to intmax_t and > using a different printf format type). At this place this would have > been enough. The root of the problem is that we have different typedefs for (u_)int64_t= =20 in 32 and 64 bit archs. Specifically, we use "(unsigned) long" on 64 bit=20 archs while 32 bit archs use "(unsigned) long long". As intmax_t is an=20 alias for int64_t this means also that intmax_t is "shorter" (for some=20 definition) than "long long". I still think that we should make it "long=20 long" on all archs as Net- and OpenBSD do. There are the dreaded PRI... macros that are supposed to fix this, but=20 that is really ugly. In general, a cast to intmax_t and %j or long long=20 and %ll seems to be the preferred sollution. =2D-=20 /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News --nextPart584704435.sdW9kyYMz7 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQBFsnQFXyyEoT62BG0RAvHjAJ9JEbOr12nICI4+Sh1ayBNpTcqdJgCfWrhB BCY66HZOcWvpVbdcgl+NM9U= =Nx2H -----END PGP SIGNATURE----- --nextPart584704435.sdW9kyYMz7--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701202056.53825.max>