From owner-dev-commits-src-main@freebsd.org Sun Jan 10 20:41:30 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0C1F4D89FF; Sun, 10 Jan 2021 20:41:30 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: from mail-qv1-f44.google.com (mail-qv1-f44.google.com [209.85.219.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DDTJp6GC6z3PYF; Sun, 10 Jan 2021 20:41:30 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: by mail-qv1-f44.google.com with SMTP id az16so6673780qvb.5; Sun, 10 Jan 2021 12:41:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=njguncw9pTEiyOi5M2jwpq5KsBxOunXV2983ce4WIOU=; b=nDb2R1lONjQfofNq9mhQWIUg/37jUvIJ/pIH9TMTJWFBhJkJeMeX7Rkkz3noguVN+D 5cftFFZX1BUq3mFbXF2q5aFBCqgUjrYQjjgxRFDleY5NwGlk0Tb2gNZMd84jOy0HCcsk psaxonaUF5voAiiHe0g22fSuEk7kLSanAg77a3HbgfeOp+ThsibduHnIhge01dBXpTId nFgnW8O3cYgTIHo55/prMzTkiAA6dcaXUpTAl9PNWW5IfEbVsCRwMH2baHlEEHG6yQZh 6ctN2Tp6d6ku8tt8FfHSexlii1cjk11eHNIS2R4YR/m4hOixofvis6ZkOf4ikMVaK3lL 2PXA== X-Gm-Message-State: AOAM53327f1OwNrJttSGIar6Bx/yW41fHyjEqgWRWZeIU6G7AwvHQ6z+ 1UyuBrkUblClM2V5ItRaCDmyFy/UxMRMWg== X-Google-Smtp-Source: ABdhPJzdzYwnmc242O9Xi0OOQXsNcZ4wsKFtF9LTz9xxk4P3BSdLNag17A8PsE/2QTxYgP/tr715Vg== X-Received: by 2002:a0c:b9a8:: with SMTP id v40mr13169724qvf.36.1610311289738; Sun, 10 Jan 2021 12:41:29 -0800 (PST) Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com. [209.85.222.171]) by smtp.gmail.com with ESMTPSA id k42sm5430069qtk.17.2021.01.10.12.41.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 10 Jan 2021 12:41:29 -0800 (PST) Received: by mail-qk1-f171.google.com with SMTP id d14so13068053qkc.13; Sun, 10 Jan 2021 12:41:29 -0800 (PST) X-Received: by 2002:a05:620a:4047:: with SMTP id i7mr13365036qko.3.1610311288912; Sun, 10 Jan 2021 12:41:28 -0800 (PST) MIME-Version: 1.0 References: <202101081729.108HTG7j066884@gitrepo.freebsd.org> <74314BD0-A0F8-481A-93A0-28FB83CB2717@freebsd.org> <202101081920.108JKUd2003299@slippy.cwsent.com> <202101081927.108JRKxR084004@slippy.cwsent.com> <202101082253.108MrrUL003251@slippy.cwsent.com> <2B913109-27A8-4ABF-8F64-48CE78B76759@FreeBSD.org> In-Reply-To: <2B913109-27A8-4ABF-8F64-48CE78B76759@FreeBSD.org> From: Ryan Libby Date: Sun, 10 Jan 2021 12:41:18 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 6733401935f8 - main - nvmecontrol: add device self-test op and log page To: Dimitry Andric Cc: Cy Schubert , Chuck Tuffli , Jessica Clarke , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4DDTJp6GC6z3PYF X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2021 20:41:31 -0000 On Sun, Jan 10, 2021 at 4:59 AM Dimitry Andric wrote: > > On 8 Jan 2021, at 23:53, Cy Schubert wrote: > > > > In message > om> > > , Chuck Tuffli writes: > >> --000000000000c9481f05b86a0c60 > >> Content-Type: text/plain; charset="UTF-8" > >> > >> On Fri, Jan 8, 2021 at 11:27 AM Cy Schubert > >> wrote: > >> > >>> In message <202101081920.108JKUd2003299@slippy.cwsent.com>, Cy Schubert > >>> writes: > >>>> In message <74314BD0-A0F8-481A-93A0-28FB83CB2717@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 > This is technically right, but it's just so ugly and so much harder to read, especially with multiple format arguments. IMHO, casting to max width is acceptable.