From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1C9CECAA24 for ; Thu, 25 Aug 2022 16:52:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242308AbiHYQwf (ORCPT ); Thu, 25 Aug 2022 12:52:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241453AbiHYQwS (ORCPT ); Thu, 25 Aug 2022 12:52:18 -0400 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 149B1BCCD5 for ; Thu, 25 Aug 2022 09:51:31 -0700 (PDT) Received: by mail-ed1-x532.google.com with SMTP id r4so26871234edi.8 for ; Thu, 25 Aug 2022 09:51:31 -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=5Ime9sYe/5PWeer0LkOW/UcYq9slhepggp91Gle2/uobxxOqJOWd1T1jkYpNbKzjCt E2R4Flu20SGuem53cS4SwuJkwoK9yyifAzLTku2kbW2MCnksUVflVCVjKmU3pfFHB4FB PyIWilgid4v350PU7Ic3z/NRFKkTonbAiua8NmOSdanJquUBXZfBNRGDFbccgt20rHfO xn1nlJK82q+UmPIU07dci3O43N5jxfHe0Fg7/hkgjDSypOrTJnRRLBa8DrQeOJHLnc/a mYrh3M0Ss89r309l3xDSuEiJvQBILJ9LfeAUNh6G5iLWYeUwJr9dFTm5lnq3ium4HRg2 no6g== X-Gm-Message-State: ACgBeo2a+zvIhxKCRIZdYGFUNXRHi/LASYE3+LJ4iWeHfOP+ONxi8UTR T5C01UX8sZWUwBw7wQY2/XNCH1QiRBUf04qfvEA= X-Google-Smtp-Source: AA6agR6CtAy0qLtA4zPp0Qp238ja03lbFmeZHeW6f1F9Vu2GTFsCXzOH16cyhvM3JbUm7D75O545vg== X-Received: by 2002:a50:9fc2:0:b0:447:8c73:299e with SMTP id c60-20020a509fc2000000b004478c73299emr3785737edf.112.1661446289272; Thu, 25 Aug 2022 09:51:29 -0700 (PDT) Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com. [209.85.208.53]) by smtp.gmail.com with ESMTPSA id g9-20020a170906538900b0073ddfe1ea69sm168961ejo.111.2022.08.25.09.51.28 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 Aug 2022 09:51:28 -0700 (PDT) Received: by mail-ed1-f53.google.com with SMTP id t5so26860849edc.11 for ; Thu, 25 Aug 2022 09:51:28 -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" Precedence: bulk List-ID: X-Mailing-List: linux-man@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