git: 6733401935f8 - main - nvmecontrol: add device self-test op and log page

Dimitry Andric dim at FreeBSD.org
Sun Jan 10 12:59:11 UTC 2021


On 8 Jan 2021, at 23:53, Cy Schubert <Cy.Schubert at cschubert.com> wrote:
> 
> In message <CAKAYmMLD5F7C_kBSVJ6vXgGmBFDK_J4053WeMSOJK07P-VQ_8g at mail.gmail.c
> om>
> , Chuck Tuffli writes:
>> --000000000000c9481f05b86a0c60
>> Content-Type: text/plain; charset="UTF-8"
>> 
>> On Fri, Jan 8, 2021 at 11:27 AM Cy Schubert <Cy.Schubert at cschubert.com>
>> wrote:
>> 
>>> In message <202101081920.108JKUd2003299 at slippy.cwsent.com>, Cy Schubert
>>> writes:
>>>> In message <74314BD0-A0F8-481A-93A0-28FB83CB2717 at freebsd.org>, Jessica
>>>> Clarke w
>>>> rites:
>>> 
>> ...
>> 
>>>>> This broke powerpc and powerpc64:
>> 
>> 
>> Sorry about that. I'll fix this in a bit.
>> 
>> --chuck
> 
> Looks like dim@ already did.
> 
> The time before last I fixed one of these it was pointed out to me
> privately that when we use %jd that we should also cast to intmax_t or
> uintmax_t, and that jhb@ told him. This was to future-proof, assuming we'd
> have 128-bit processors one day.

That is certainly valid for e.g. time_t or other types with a varying
width, or where you cannot predict the exact width.

But for printing uint64_t and friends, where the width *is* exactly
specified, I would rather just use the standards-defined PRIu64 and so
on. Casting will obscure any type mismatches between the printf format
strings and the actual arguments.

-Dimitry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 223 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.freebsd.org/pipermail/dev-commits-src-all/attachments/20210110/02af3f5b/attachment.sig>


More information about the dev-commits-src-all mailing list