Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp843770rwe; Thu, 25 Aug 2022 10:04:22 -0700 (PDT) X-Google-Smtp-Source: AA6agR434su1iV3CE+O4cnWcSledw37jbotUDTxtK++umGMdu0hXPvhfeb/hYkmbSJ59KSD146p8 X-Received: by 2002:a17:90b:1d83:b0:1fb:6795:5cc9 with SMTP id pf3-20020a17090b1d8300b001fb67955cc9mr75376pjb.162.1661447061974; Thu, 25 Aug 2022 10:04:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661447061; cv=none; d=google.com; s=arc-20160816; b=JWxzCzq90PFGelngdmmwUAzzK/lJKtMivNWhhqaq1NXootIo/lkQA0HAEEtCc9ZI9T rNjKe8CVcMkdIDNhAU1RUxPcsNffyBXcw351KGI0XSILa1faOdIruH66G1IY+uVi0t7+ 48tlpyTHZrz+gTwntySdN5HO9EOvpFkGTFzLWte3DmsP37WgQmyJOTbTf9+UwHiXcFit z6RQOxeNSM9wku+Pmddj4mqoKALm7oo7/a3YtJj43Lv1L81o8ekTi4UGSFjKWqe+R/YQ zrn3k/cg/vEhSwrLOMdNUP0baDvhbuFmR5zjSM25qednaetuTYiwILxeyYjkgRwv1Vgl fP/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Zej4CxY/1CWynJQcpIFCE/ePm/cZkXwlSREUqfzuJ8Y=; b=F61eZBsvNMUbJhW+cF0ZDbfa8bFst+dNcnrY6Py+Xkq9/aNzKOxJ8/VlCyoWc4uNgy NNkCabr0rGuRRT4nOW4YrqPlvI7SCqPwOXfFXKI5E75xmmHRnN85AszuTtcVdhPiTu+I bmjniWfu8gcLM4Np0QIAbrz3jnp2eJ2tdlipuIKXvd/Hkt99mlQpQ3WFbIjMHvUybS+a 20BjLEEvRgvbrHZKS2kUwaxqKjWc2uko5Da1rumV+oWDkM6DL/eJixQUlqo05Q1yFnPH WaKn6mBa3dQWgOj7Jot06q32M1wJtbgucFwfYQeQ+wkZRpbafDaQjeU931DkJHO6M5Ux 07bQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=h5BQlI0x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k9-20020a170902ce0900b0016db1b1a7adsi22182424plg.210.2022.08.25.10.04.02; Thu, 25 Aug 2022 10:04:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=h5BQlI0x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243442AbiHYQvr (ORCPT + 99 others); Thu, 25 Aug 2022 12:51:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243856AbiHYQvF (ORCPT ); Thu, 25 Aug 2022 12:51:05 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1A9DBB93B for ; Thu, 25 Aug 2022 09:49:37 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id d23so24657659lfl.13 for ; Thu, 25 Aug 2022 09:49:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=Zej4CxY/1CWynJQcpIFCE/ePm/cZkXwlSREUqfzuJ8Y=; b=h5BQlI0xIEyNRWKjxWMt8RcIcaw6Iab9Lro//TN7cNvmYLCYmjHA9b7vqil1aO5lR2 jjncnbXB0E5n8vUT5r/OBW2cdzESp8HNiF0+6Am4i8gbPE/IF29BiN++mET+t+9HhGXy KU+7dVHbSPecBR62YILXw08KL2z9er7opHtdU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=Zej4CxY/1CWynJQcpIFCE/ePm/cZkXwlSREUqfzuJ8Y=; b=mglY1DN7T1xJcc4a++eQSdEIgKr18V19+yDK88OfgingfLNZiqoLpYMHXdxFfvkSiD NY9pIBbgTgiEb/fNNWm+6BICVQyC1YFa83hGwJT6v/jfJ+EYEXnq17Ieqb9/W3cFFeLZ UID/M6EOQiGduuPn+xfJco7oixHMILtS8fSxONmv6TyEu+kQhn5QLLd1prs7xRk+IDwG oeHg7aHkvZplvLERVgb+sXMLf8qEqFyd4i0BD2VekhTSItdKCx/fJfIVEVBEx2TDmwAN la2eR5sX+v8GgGOw3dysq5pWJEZazl/fl8NGrptUG+1DtkvfaEtR05JoeVi/q3avfCt8 KYXQ== X-Gm-Message-State: ACgBeo1ZmQFj3FGgH5bK9ZqmCHfOPbSdVzNZqKRii6254tGJnrg32D5V hqxyuuRfPMP+bl99FCxu8FEsvEg1XtR0tdhJn4s= X-Received: by 2002:a05:6512:2314:b0:492:b612:5390 with SMTP id o20-20020a056512231400b00492b6125390mr1582741lfu.115.1661446175821; Thu, 25 Aug 2022 09:49:35 -0700 (PDT) Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com. [209.85.167.42]) by smtp.gmail.com with ESMTPSA id 124-20020a2e0982000000b0025e4e7c016dsm672186ljj.16.2022.08.25.09.49.35 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 Aug 2022 09:49:35 -0700 (PDT) Received: by mail-lf1-f42.google.com with SMTP id l8so11495145lfc.12 for ; Thu, 25 Aug 2022 09:49:35 -0700 (PDT) X-Received: by 2002:a05:6000:1888:b0:222:ca41:dc26 with SMTP id a8-20020a056000188800b00222ca41dc26mr2680808wri.442.1661445807749; Thu, 25 Aug 2022 09:43:27 -0700 (PDT) MIME-Version: 1.0 References: <20210423230609.13519-1-alx.manpages@gmail.com> <20220824185505.56382-1-alx.manpages@gmail.com> <87ilmgddui.fsf@oldenburg.str.redhat.com> In-Reply-To: From: Linus Torvalds Date: Thu, 25 Aug 2022 09:43:11 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3] Many pages: Document fixed-width types with ISO C naming To: Joseph Myers Cc: Florian Weimer , Greg Kroah-Hartman , Alejandro Colomar , Alexei Starovoitov , Alex Colomar , Alexei Starovoitov , linux-man , Daniel Borkmann , Zack Weinberg , LKML , glibc , GCC , bpf , LTP List , Linux API , linux-arch , David Laight , Cyril Hrubis , David Howells , Arnd Bergmann , Rich Felker , Adhemerval Zanella , Michael Kerrisk Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 25, 2022 at 7:38 AM Joseph Myers wrote: > > I've not yet implemented it for glibc or for GCC format checking, but C23 > adds 'wN' format length modifiers so you will be able to e.g. use "%w64d" > with printf to print an int64_t and won't need those PRI macros any more. Yeah, that's going to help user space. We don't typically have huge issues with it (any more) in the kernel exactly because we refused to do the syntactically horrendous PRIxyz thing. So in the kernel, we still do have some format string issues, but they tend to be about "different architectures and configurations do different things for this type", and those different things are sadly not necessarily about a fixed width. IOW, we used to have horrors like "sector_t can be 32-bit or 64-bit depending on config options" (because small machines didn't want the overhead of having to pass 64-bit things around - from back when 32-bit was a primary target). We got rid of *that* thing a few years ago because it just wasn't worth supporting any more, but some similar issues remain. So we still have a number of cases of "if you really need to print this out, you need to use '%llui' and cast the value to 'unsigned long long'". But it's happily not as common as it used to be. Linus