Date: Fri, 8 Jan 2021 15:15:35 -0800 From: Mark Millard <marklmi@yahoo.com> To: Dimitry Andric <dim@FreeBSD.org>, dev-commits-src-main@freebsd.org Subject: Re: git: a82f07fc2e24 - main - Fix 32-bit build post 6733401935f83754b4b2744bc3d33ef84b1271e0 Message-ID: <7BAE448B-2C76-4EE8-B64F-9949E078CE54@yahoo.com> References: <7BAE448B-2C76-4EE8-B64F-9949E078CE54.ref@yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Dimitry Andric dim at FreeBSD.org wrote on Fri Jan 8 22:39:16 UTC 2021 : > . . . > The general style in sbin/nvmecontrol apppears to print uint64_t types > using %j, so I'm using that instead of the more general (but admittedly > ugly) PRIu64. > . . . > - printf(" FLBA=0x%lx", failing_lba); > + printf(" FLBA=0x%jx", failing_lba); > . . . %jx is for uintmax_t values on the stack, which may have more bits than uint64_t would. It looks to me like a (uintmax_t) cast is missing to make sure that the format specifier and value on the stack agree about the memory use. (FreeBSD seems to have standardized on %jx and %jd and such, mixed with the matching cast to uintmax_t or intmax_t for handling the varying sizes across platforms. At least I've seen a lot of examples of such code in the past.) === Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7BAE448B-2C76-4EE8-B64F-9949E078CE54>