Date: Sat, 10 Jun 2006 17:31:16 +0400 From: Yar Tikhiy <yar@comp.chem.msu.su> To: Craig Rodrigues <rodrigc@FreeBSD.org> Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/gnu/fs/xfs xfs_fs.h Message-ID: <20060610133116.GA4017@comp.chem.msu.su> In-Reply-To: <200606090657.k596v04m037835@repoman.freebsd.org> References: <200606090657.k596v04m037835@repoman.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060610133116.GA4017>