cvs commit: src/sys/gnu/fs/xfs xfs_fs.h

Yar Tikhiy yar at comp.chem.msu.su
Sat Jun 10 19:10:28 UTC 2006


On Fri, Jun 09, 2006 at 06:57:00AM +0000, Craig Rodrigues wrote:
> rodrigc     2006-06-09 06:57:00 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/gnu/fs/xfs       xfs_fs.h 
>   Log:
>   Change %llx to %jx in printf() to eliminate warnings on 64-bit platforms.
>   
>   Revision  Changes    Path
>   1.3       +1 -1      src/sys/gnu/fs/xfs/xfs_fs.h

> ===================================================================
> RCS file: /usr/local/www/cvsroot/FreeBSD/src/sys/gnu/fs/xfs/xfs_fs.h,v
> retrieving revision 1.2
> retrieving revision 1.3
> diff -u -p -r1.2 -r1.3
> --- src/sys/gnu/fs/xfs/xfs_fs.h	2006/06/09 06:04:03	1.2
> +++ src/sys/gnu/fs/xfs/xfs_fs.h	2006/06/09 06:57:00	1.3
> @@ -129,7 +129,7 @@ struct getbmapx {
>  	p2.bmv_count = p1.bmv_count;	\
>  	p2.bmv_entries = p1.bmv_entries; \
>  	\
> -printf("offset 0x%llx block 0x%llx length 0x%llx count 0x%llx entries %d\n", \
> +printf("offset 0x%jx block 0x%jx length 0x%jx count 0x%jx entries %d\n", \
>         (uint64_t)p2.bmv_offset, \
>         (uint64_t)p2.bmv_block, \
>         (uint64_t)p2.bmv_length, \

I'm afraid this is still not quite correct.  AFAIK, one should not
assume that uintmax_t is the same as uint64_t; it's a mere coincidence
we have now.  The casts should be changed, too, from (uint64_t) to
(uintmax_t).  Then it will become the only safe way to printf an
integer of a non-basic type.

-- 
Yar


More information about the cvs-src mailing list