[head tinderbox] failure on amd64/amd64

Max Laier max at love2party.net
Sat Jan 20 20:09:44 UTC 2007


On Saturday 20 January 2007 20:32, Alexander Leidinger wrote:
> Quoting FreeBSD Tinderbox <tinderbox at freebsd.org> (Sat, 20 Jan 2007 
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 
in 32 and 64 bit archs.  Specifically, we use "(unsigned) long" on 64 bit 
archs while 32 bit archs use "(unsigned) long long".  As intmax_t is an 
alias for int64_t this means also that intmax_t is "shorter" (for some 
definition) than "long long".  I still think that we should make it "long 
long" on all archs as Net- and OpenBSD do.

There are the dreaded PRI... macros that are supposed to fix this, but 
that is really ugly.  In general, a cast to intmax_t and %j or long long 
and %ll seems to be the preferred sollution.

-- 
/"\  Best regards,                      | mlaier at freebsd.org
\ /  Max Laier                          | ICQ #67774661
 X   http://pf4freebsd.love2party.net/  | mlaier at EFnet
/ \  ASCII Ribbon Campaign              | Against HTML Mail and News
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-amd64/attachments/20070120/0a5be867/attachment.pgp


More information about the freebsd-amd64 mailing list